• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Key-Value pair to Serial port

 
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wondering how can i (honestly what format) i can send value to serial port.

Let's say i have following key-value pairs
['id'] => 10
['name'] => 200
['lSend'] => 0 // means Off
['pSend'] =>1 // means On
['lStartHour'] =>12
['lStartMins'] =>23
['lStopHour'] =>12
['lStopMins'] => 35 ......

I know i have to convert those values to byte but if i merge all those values and i will have very long 1 and 0eos
how come PIC card will understand which value for which key?

Also, i have read portion of this code which means Java program will receive 1 and 0eos how can i know which data which key's because i have to write those values into DB.

Regards
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The serial port doesn't need to understand the data in any way. Its only job is to transmit the data to whatever is connected to the other side.

So the only entity which needs to understand the data is the software listening at the other side of the serial port. If it already has specs on what format you should use, then you should use that format. Otherwise you and the writer of that software should get together and agree on the format. There's plenty of choice.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:There's plenty of choice.



Can you give me some hint/choice please.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSON. Java serialization. XML. There are more... why don't you discuss it with the person working on the receiving program?
 
reply
    Bookmark Topic Watch Topic
  • New Topic