views:

69

answers:

4

i have never done embedded (i dont know if thats what you call this) programming and know nothing about it. my question:

  1. is it possible to have two devices sharing a wireless connection (no internet, just between themselves, perhaps bluetooth, but i dont know what ever is best) ?

  2. is it possible to have one editing a file and the other person editing the same file and they can see changes in real time? sort of like google docs?

  3. does this exist already?

  4. what can i do to get started regarding this kind of programming?

to clarify:

i want two people with iphones or any other hand held device, to be able to edit a text file at the same time and see each other's changes in real-time. how do i do this?

+2  A: 

There are a bunch of slightly strange assumptions hidden in your questions. I'll try to unpick them as best as I can.

You've used "embedded" programming in a strange way. Usually this would suggest some kind of low-power devices used in settings without direct user interaction in some sense (e.g. factory controllers, refrigerator controllers, sensor nodes), performing a very specific task, but you've gone on to talk bout people editing files. What exactly would be the user interface here? What would make this embedded programming? I think you need to describe an application before any advice can be offered.

If you actually mean embedded devices, then whether they can connect wirelessly to one another is going to depend on the nature of the device. Similarly, the protocol/technologies involved will depend on the device. Embedded programming tends to be very much device-specific. There certainly exist wireless sensor nodes, for example, that incorporate small radio transceivers for serial comms.

Google docs already exists. Without a clearer problem description it's difficult to say whether what you want exists already or not.

I think you should really figure out exactly what kind of programming it is that you want to do before we can offer points as to how to best get started with it. Maybe look up a definition of "embedded programming" and see how this relates to your goals such that you can reformulate your questions a little more clearly.

I'm not sure how "real time" would fit into this scenario either. This term is used and abused in many ways. Things are only ever real-time with respect to some constraint, usually defined in terms of the application.

(Note: This might have been more appropriate as a comment, but I felt there was too much to respond to in order to sum up within character limits, and I hope correcting some of the confusion constitutes something of an answer, given the limitations of the question).

Gian
updated question
I__
OK, just to make perfectly clear, from your edits, you are trying to develop something within the space of _mobile computing_. Embedding computing is something quite different. A device such as an iPhone is essentially a general-purpose computer that just happens to be very portable. Development for these platforms constitutes application development, in the most general terms, and is unrelated to the kinds of development challenges that most embedded platforms impose.
Gian
thank you very much i will retag
I__
+1  A: 

"iphones or any other hand held device" - the technology stack to do that doesn't exist today. You have to co-ordinate between multiple languages and systems. (Okay, maybe you want to write that software, but it's a huge undertaking).

Your best bet would be to create a web page that all of the mobile browsers can work on and save a text file from.

Paul Nathan
That depends on whether your interpretation of "any" is "for all" or "there exists" — I doubt I could edit a text file on my calculator.
tc.
@tc: well, I'm inferring that the OP is implying typical smartphoney devices. Also, my awesome HP-49g+ does text file editing. it is pretty spiff.
Paul Nathan
+1  A: 
  1. Two devices can share a connection like this. It's done all the time. There are many many protocols for this. Weather or not it is wired or wireless or uses the Internet doesn't really matter for 90% of this.

  2. This is sort of doable, but not really. You really have a race condition when two people are editing at the same time. This is generally avoidable by locking out small parts of the document at from all but one editor at a time (like only one person being able to edit one cell of a spreadsheet at a time), but this has problems too (like of the one active editor is taking way too long -- this is a problem seen in many source version control systems too).

  3. 1 already exists in many many forms. 2 sort of exists in many forms, but the problems I mentioned are impossible to completely overcome.

  4. The way you asked this question leads me to believe that you are very far from being able to do this. In addition, you didn't tell us anything about what you do know how to do. Can you write a simple text editor for an iPhone (or anything else)? Simple text editors from scratch that aren't crappy aren't easy to write.

What you need to do, if you really want to do this, is to come up with a protocol for the two (or more) devices to talk to each other in. To do this it is probably best if you figure out what type of communication is available between the devices and which of those you will use and what features it does not provide that you will need on top.

You could try to send patches of the file (or something similar) between the two devices as edits are made, but then you'll have to decide what to do in the event of a collision (edits near the same place).

Alternately you could have the two devices exchange permission to make edits (like in token ring networks).

You still have a problem if the two devices lose communication with each other during the editing of the file, though. With the token ring type setup you stand the possibility of losing the token and neither being able to automatically recover easily. Whatever you do you end up with the problem of the two ending up with different ideas of the file's contents.

nategoose
I'd implement it with a master/slave protocol. The slave can just send keypresses.
tc.
I meant to mention that one of the devices could be the _owner_ of the file and the other just attempts to get the owner to do the edits on it's behalf, and gets updates. Keypresses may be too low level of an edit request, though, as the _owner_ then has to keep up with lots of state info about the remote editor/viewer. The remote device would then be a terminal, though, which has been done, though its user is likely to experience slow feedback on the movements and edits they make.
nategoose
A: 
  1. Of course it's possible. Bluetooth does this. Wi-Fi does this if you join an ad-hoc network.
  2. Of course it's possible. Just run the Google Docs server on one of the devices.
  3. It might.
  4. Way too vague.
tc.