Quotes problem

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
pmitev
Member
Posts: 4
Joined: Mon Mar 15, 2004 5:44 pm

Quotes problem

Post by pmitev »

Well maybe I don’t know the trick yet, but...

I am sending through the serial pot ASCII string containing quotes. Everything works fine. I can check that the string is properly saved into configuration file, but when next time I open the program I got the string up to the first quote.



Example

Original string: AT*EAM="Menu"

Which appears in the config as:

…..

<Command NAME="AT*Menu" Type="Ascii">

<Send Data="AT*EAM="Menu""/>

…..



But when it is read in it appears as follows: AT*EAM=



????

Well I am stacked... I have tried some special characters encoding but I haven’t succeed, yet.

I will appreciate any suggestion.

By the way – GREAT PROGRAM!!!
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

The problem is that I don't escape the data when it is saved to the XML configuration file. When read back, the data gets terminated at the quote. It should be fairly simple to fix, but you'll need to let me know which Hardware Interface you are using. There are a couple that use the same generic serial command logic.



The only other alternative is that you could enter the data as hex values.
Scott
pmitev
Member
Posts: 4
Joined: Mon Mar 15, 2004 5:44 pm

Quotes problem - possible solution ???

Post by pmitev »

Thank you for the prompt answer.

I think I am using the standard generic serial port interface...

It looked to me as a natural choice...



Well, do you thing that it will work if I manually replace my quotes in the config file with " ? Anyway I am going to try that once I got home, it was too late yesterday for this trick 8)



hex encoding looks to me as a nightmare because the next command which I have to send has 11 quoted strings...



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

Post by ScottBot »

Encoding the quote yourself won't really help because the code doesn't decode it when it reads the configuration file.



I've changed the plugin to now encode/decode special characters for the data string. You can download a ZIP file with the modified plugin here. To install it...
  1. Stop HouseBot.
  2. Unzip the new plugin and copy it to the ...\HouseBot\Plugins\Interfaces directory. You may want to backup the old file before copying over it.
  3. Start HouseBot and let me know if this works for you.
Scott
pmitev
Member
Posts: 4
Joined: Mon Mar 15, 2004 5:44 pm

Post by pmitev »

ScottBot wrote:......
3.Start HouseBot and let me know if this works for you.
Works like a charm...

Thanks for beeng so kind!
pmitev
Member
Posts: 4
Joined: Mon Mar 15, 2004 5:44 pm

Well - I still have problems...

Post by pmitev »

Well, I didn’t have the time to test everything so I have checked only that the configuration is saved and read after that correctly. Then today I just tried to play a little bit and see what I got…

When I send the command string – the quotes there are encoded… so I am trapped again.



Image

Image



I don’t know what to expect with the next command when I will put all quoted string into the property value to be transmitted… as it is on the 3th line on the first picture.



Ok, I checked. It works like that... maybe I should stick to that model...
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

I tested it to the same extent as you. It seemed to save the config data right, so I was happy.



I missed one additional spot to decode the string. I think this should do it. I've not tested it, but it's a pretty simple change (Not that my previous testing was very conclusive anyway).



You can download it from here.
Scott
Post Reply