Serial control mapping

Have an idea for a new feature? Voice your opinion here.
jasonb1
Member
Posts: 34
Joined: Tue Nov 11, 2003 12:50 am

Post by jasonb1 »

Okay, I finally figured out what's happening and it doesn't seem like it can work properly in all cases.



It looks like the plugin takes two numeric digits in decimal and converts that to hex for the the output. The problem with that is that you can't turn any numbers over 99 into the proper hex digits.



So, I can put in 99 and it sends out 63. If I put in 255, it sends out 0237 instead of FF.



So, could you change it to expect those numbers in hex?

- Jason
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Try this one.



Use a %x% for the substitution chars.



Scott
jasonb1
Member
Posts: 34
Joined: Tue Nov 11, 2003 12:50 am

Post by jasonb1 »

That works fabulously! Thanks very much for being so responsive. 8)

- Jason
jasonb1
Member
Posts: 34
Joined: Tue Nov 11, 2003 12:50 am

Post by jasonb1 »

I've ordered a Global Cache device, and was wondering if this change could be made there as well for it's serial support?

- Jason
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Sure. I'll look into it next week sometime.



Scott
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Jason,



I've updated the Global Cache plugin on the web site to include this.



Scott
MediaStorm
Member
Posts: 30
Joined: Sat Jun 28, 2003 1:58 pm

Another SERIAL request

Post by MediaStorm »

How about the inclusion of a command 'suffix' and 'prefix'?



Many devices want a certain control character before the command and another after the command..



Kenwood receivers, for example, use a format like this:



Ctrl-A<COMMAND>Ctrl-B



Command looks something like VOL2B which is a combination of Ascii and HEX.



With the inclusion of suffix/prefix it would make it very simple to build the serial command such as:



VOL%x%



While we're on the topic of HEX, how about a checkbox or something to allow for padding HEX values? This should be very simple..



With padding enabled anything single digit (byte) would be zero padded to 2-bytes length.



IE- 0-15 would be padded as 00 - 0F



This would take care of the bulk padding need for lots of different devices and shouldn't be much to implement at all.



Of course it is easy enough to do this in VBScript for one or two functions but becomes a complete pain when you have 20-30 functions that all need padding. It could be pulled off with some creative scripting but a padding option such as above would tackle it and simplify things a bunch.



As a thought to an alternate approach for prefix/suffix, how about a way to muck around with data to be sent prior to sending? I'm thinking something like a data_to_send_in and data_to_send_out. Anytime data_to_send_in changes you can muck with it in a VBScript and then Housebot sends out whatever it finds in data_to_send_out.. If data_to_send_out is empty (ie-wasn't touched or handled) HouseBot could copy data_to_send_in to data_to_send_out if data_to_send_out is NULL. That's a verbose explanation but I think you should get the general idea. Again.. Something that could be done currently with some tricky scripting but a global makes sense and combined with padding option above would be incredibly useful.



These two functions would eliminate about 90% of the stunt work required to do something similar in various scripts.



In summary:



Request 1 - Either a prefix/suffix command (ala command terminator style) or better yet a global in out varible set that can be massaged and sent at script termination.



Request 2 - Option to zero pad hex values 0-15 to 2 byte length (on a PER command basis).



Actually with request 1 in place it wouldn't be hard to do request 2 via a script but I think the checkbox option would be much cleaner and more simple for non-script savvy types.
ScottBot
Site Admin
Posts: 2790
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Good suggestions. I'll add them to the list.



Scott
Post Reply