teknikill.net Forum Index teknikill.net
Motorola IMfree (MX240) Messageboard
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Intermediate protocols

 
Post new topic   Reply to topic    teknikill.net Forum Index -> Development
View previous topic :: View next topic  
Author Message
lou
Developer


Joined: 07 Oct 2005
Posts: 34
Location: TN, USA

PostPosted: Sun Nov 27, 2005 9:01 pm    Post subject: Intermediate protocols Reply with quote

There has been talk of what I'd call intermediate protocols.
Protocols somewhere in between what the base speaks and one's actual program. I've been thinking of implementing one or more such protocol to make my code useful to more people.

The problem is one of guessing what you want.

There are several places where one might choose to implement such an interface. One is at the base level, where all commands are simply translated and forwarded. The other is at the handset level, where only commands addressed to/from that handset appear at the interface. A third option, which is very similar to the handset level, is the service level, where one of the parties to the communication is some sort of service handler.

The basic protocol itself, would probably be keyword/value based, terminated by a newline, with some sort of escaping scheme in case the data contains a newline, which, as far as I can tell, never happens in practice.

Even once all that is decided on, there is the matter of how the interface is accessed. Is it parent/child communication over stdin/stout? Does something listen on a network socket? If so, which party is doing the listening? Should it be some sort of broadcast medium? Shared memory? Multicast?

None if this is really for me; it is for you. If you don't want it, I won't bother. A document specifying the protocol will have to be compiled and agreed upon before I put a lot of work into implementation.
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Mon Nov 28, 2005 9:40 pm    Post subject: Reply with quote

Hmm,

I would like to be able to write vb.net applications with a minimum of hassle using the device.

I would like to be able to send information to the IMFree screen with formatting (character positioning) and graphics if the LCD is capable of displaying graphics.

I would like to either through an event or through polling get information from the keyboard.

Thus I suppose this is closest to the "service" level.

Spektre
Back to top
View user's profile Send private message
lou
Developer


Joined: 07 Oct 2005
Posts: 34
Location: TN, USA

PostPosted: Tue Nov 29, 2005 12:12 am    Post subject: Reply with quote

Spektre wrote:
Hmm,

I would like to be able to write vb.net applications with a minimum of hassle using the device.


That is the sort of thing that this is intended for. I cannot help you with the actual vb.net code to glue things together, but we can engineer a line protocol that is easy for you (and others) to deal with in whatever language you choose. If you can write a class (or whatever it is called in vb.net) and access whatever form of IPC is used, your end of this should be pretty simple.

So, Assuming that a daemon is running to handle the base device, how would you want your program to access the daemon? Or do you want it to contact your program? Do you want the daemon to start your program when a handset comes online? Do you want a scheme that I haven't mentioned? You are the only person discussing this with me so far, so your opinion carries a fair amount of weight.

Spektre wrote:

I would like to be able to send information to the IMFree screen with formatting (character positioning) and graphics if the LCD is capable of displaying graphics.

I would like to either through an event or through polling get information from the keyboard.

Thus I suppose this is closest to the "service" level.

Spektre


Bonus points for using the word "thus". Smile

The kind of control that you desire is not available from the device as far as we know. It is really very primitive. There are no graphic characters available. You can insert smileys in the output by putting the text equivalent there, but the downside is that if you really want a colon, a hyphen, and a close paren in your output text, you get a smiley instead. Though I think the LCD hardware, itself, is probably capable of doing arbitrary graphics, the firmware in the device doesn't allow that functionality, that we know of. The only keyboard events that come from the device are when the user sends an entire message or presses the "warn" button. I was disappointed too.
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Tue Nov 29, 2005 1:40 am    Post subject: Reply with quote

Hmmm,

I will freely admit I have not defined OS hooks before in vb.net, simply use ones made before so I will most likely be slow on my end. Also, i am working on acquiring a few IM Free's currently.

There is a version of stdin/out in .net, but I don't see it routinely used.

There are probably other good ways to do it but a socket interface sounds good at first glance. Either straight tcp or maybe a telnet interface. That way, i could use premade events from the sockets class. Multicast might be another idea as you could have multiple listeners then.

Shared memory, probably not so great in Windows.

So...

Let's say my client either connects to a network socket or starts to listen for a multicast.

I am assuming the unit has one of its 9 lines of display reserved for the message you are currently inputting. Do the rest of the lines simply scroll up as used? Is there any information that cannot be removed from the screen (such as screen names to start the beginning of each line)? If not, then I would forsee a simple command structure ala...

Each line receiving is:

Each line sending is:


The daemon/service would add the address incoming to know which IMFree it is coming from and parse the address on the output string to know which it is going to.

Spektre
Back to top
View user's profile Send private message
lou
Developer


Joined: 07 Oct 2005
Posts: 34
Location: TN, USA

PostPosted: Tue Nov 29, 2005 2:55 am    Post subject: Reply with quote

Spektre wrote:
Hmmm,
I am assuming the unit has one of its 9 lines of display reserved for the message you are currently inputting. Do the rest of the lines simply scroll up as used? Is there any information that cannot be removed from the screen (such as screen names to start the beginning of each line)?


The display has 1 line of display for the message you are currently typing.
It has one line for the 6 button labels.
It has one for status.
It has 6 for the conversation, and everything you type gets echoed there along with what the other party types. Every line does begin with the party's name and a colon in reverse video, and they scroll up when used. You can scroll up to previous lines using two dedicated hardware scroll buttons.

Spektre wrote:

If not, then I would forsee a simple command structure ala...

Each line receiving is:

Each line sending is:


The daemon/service would add the address incoming to know which IMFree it is coming from and parse the address on the output string to know which it is going to.

Spektre


This would be at the "base" level. So you pretty much just want to use my daemon to forward all events in a friendly form to yours, and your program will handle multiple handsets. Is that correct? We can proceed as such. It is probably just a matter of subclassing one of my existing classes. The "handset" or "service" levels would not involve addressing, as it would be implicit in the connection. (a given connection would only receive comms for one handset).

The messages are more complicated than just text. Text is just one of the types in each direction. There are also messages for things like logging in, leaving a chat, sending ringtones to the handset, etc.

Since I do not have a Windows machine, I will need your help with porting whatever needs to be ported. You can start by checking out the IMopen project from CVS and compiling it to see where it breaks. It assumes a POSIX environment (in addition to the dependencies mentioned in the INSTALL file), so you may have to use Cygwin. You can also get an idea of what-all types of events have to be handled by looking at the Base, Handset, and Service header and .cpp files. All of the messages from the base to the handset have recv_* handlers in Service, and the messages from handset to base which require special handling have send_* methods in Handset. Those are just the events that handsets care about. There are others in Base for things like registering handsets.

As for the enumeration of messages, I keep thinking I should write a whitepaper or something. Since I actually have a little time now, it might actually get done and I'll see if a mod will post it in the documents section on SourceForge. A Wiki would be good for this, but we don't have one.
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Tue Nov 29, 2005 3:21 am    Post subject: Reply with quote

Yes, handling multiple handsets in the client would be easy enough, that way the daemon/service would simply pass all the information, and the client can filter which handset it is coming from/to.

I doubt I will be of much help in porting anything. I write fairly simple vb.net applications.

For the most part, all the applications I can think of use the IMFree as a "super remote control", and thus it would be more useful if logging in, leaving a chat, etc. are not exposed to the client. If they must be (i.e. it is too difficult to bury al of it in the daemon) simple defaults should be established to bypass this not often used functionality.

I'll try to check out the IMOpen CVS.

Spektre
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Tue Nov 29, 2005 3:46 am    Post subject: Reply with quote

I don't see any files in the CVS.

edit: OK found it.
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Thu Dec 01, 2005 4:23 am    Post subject: cygwin Reply with quote

Sorry, new to Unix cross-compiling. Is there a standard build of cygwin which includes a gcc compiler and everything else I need to get up and running? My use of this previously has been limited to needing the .dll for applications.

Spektre
Back to top
View user's profile Send private message
lou
Developer


Joined: 07 Oct 2005
Posts: 34
Location: TN, USA

PostPosted: Thu Dec 01, 2005 5:02 am    Post subject: Reply with quote

When you install cygwin using their install tool, you, at one point, are presented with a list of packages to install or not. It has been awhile since I've done it, but the ones you want are probably under a group called "Development" or similar. gcc, g++, libraries, binutils, make, etc. Doing the cygwin install that way will also install the DLL. I don't think cygwin is going to have some things you'll need, such as the boost libraries. Those, you'll just have to build yourself using the included directions. You should do that from within a cygwin command shell (as opposed to a DOS command box) so that the paths agree with what the build tools are going to want to see.

The install binary can be gotten from cygwin's web site. http://cygwin.com/ Look for the icon that looks like a black "C" with a green triangle in it. Those are links to the install tool.

If I had a windows machine, I'd be able to be of more help, but I do not.
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Mon Jan 02, 2006 7:32 am    Post subject: Reply with quote

Well , I have some free time now that the holidays are over, but looking at this, I think it is out of the scope of what I do.

Cross compiling Linux aps for Windows doesn't seem so fun.

Good luck.

Spektre
Back to top
View user's profile Send private message
Spektre
newb


Joined: 28 Nov 2005
Posts: 9

PostPosted: Sat Jan 07, 2006 6:43 am    Post subject: Reply with quote

I guess this COULD end up being easy HAHA!

Lou are you still here. If you are willing to step by step me thru the cross compiling I'll give it a go. I have cygwin installed.

Spektre
Back to top
View user's profile Send private message
lou
Developer


Joined: 07 Oct 2005
Posts: 34
Location: TN, USA

PostPosted: Sun Jan 22, 2006 10:24 pm    Post subject: Reply with quote

Spektre wrote:
I guess this COULD end up being easy HAHA!

Lou are you still here. If you are willing to step by step me thru the cross compiling I'll give it a go. I have cygwin installed.

Spektre


I'm still here. I don't check in as often as I used to since not much has been happening.

If you have an AIM or Yahoo! IM account, we can iterate through the process there rather than boring all of the nice people here with it. Besides, it will probably go more quickly that way. PM me on the board with what IM service and ID to chat with and what time is good, and I'll try to be online.

I probably know about the same amount about Windows that you do of Linux.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    teknikill.net Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group