CRTP - Message Contents Question
Posted: Thu Oct 18, 2018 3:00 am
Hi all,
Had some small questions on the CRTP protocol - some of which isn't covered entirely in the wiki.
1. For sending messages to port 5, channel 1 (add block), the message structure seems to be:
byte 1 - port/link/channel
byte 2 - command (add block)
byte 3 - ID of block (?)
byte 4-end - not sure?
What do bytes 4-end of the message describe?
I can tell that the "start block" messages have the port, command, block ID, then period. Do the add block messages contain the group/name the ID belongs to?
2. Is the ID of the block the same as the ID of the variable contained within? Can you add multiple variables to one block? In my case, it would be fine to have one block for one variable to avoid confusion.
3. I am trying to retrieve variables such as battery, position (loco positioning system), sensor data (temp, etc), and roll/pitch/yaw/thrust (actual). Are all of these variables within the logging system, or do I need to query the parameters port instead? Sorry, little confused here, as these seem to change with operation so I assume they are not static - whereas the parameters port keeps information which stays the same through operation. So I assume they are all in the log.
4. Upon retrieving the TOC info, the PC client seems to know which log blocks it wants to add/start. How would I know the ID for the relevant variables without retrieiving every item (from 1-log_len) and then using that to determine the ID of the variables I want to log? For example, is "battery" always at the same ID? Can I retrieve this item at the same ID every time without first checking where the items are in the TOC?
5. Is the TOC common to the parameters and log port? Or do they each have separate TOCs? When I retrieve items within the TOC via logging, only 15 seem to respond or "exist". The rest, out of log length, do not send items back to me. Are the rest of those items parameters?
Thanks guys, I keep rereading the wiki but I think I may have misunderstood some things.
Cheers,
Jess
Had some small questions on the CRTP protocol - some of which isn't covered entirely in the wiki.
1. For sending messages to port 5, channel 1 (add block), the message structure seems to be:
byte 1 - port/link/channel
byte 2 - command (add block)
byte 3 - ID of block (?)
byte 4-end - not sure?
What do bytes 4-end of the message describe?
I can tell that the "start block" messages have the port, command, block ID, then period. Do the add block messages contain the group/name the ID belongs to?
2. Is the ID of the block the same as the ID of the variable contained within? Can you add multiple variables to one block? In my case, it would be fine to have one block for one variable to avoid confusion.
3. I am trying to retrieve variables such as battery, position (loco positioning system), sensor data (temp, etc), and roll/pitch/yaw/thrust (actual). Are all of these variables within the logging system, or do I need to query the parameters port instead? Sorry, little confused here, as these seem to change with operation so I assume they are not static - whereas the parameters port keeps information which stays the same through operation. So I assume they are all in the log.
4. Upon retrieving the TOC info, the PC client seems to know which log blocks it wants to add/start. How would I know the ID for the relevant variables without retrieiving every item (from 1-log_len) and then using that to determine the ID of the variables I want to log? For example, is "battery" always at the same ID? Can I retrieve this item at the same ID every time without first checking where the items are in the TOC?
5. Is the TOC common to the parameters and log port? Or do they each have separate TOCs? When I retrieve items within the TOC via logging, only 15 seem to respond or "exist". The rest, out of log length, do not send items back to me. Are the rest of those items parameters?
Thanks guys, I keep rereading the wiki but I think I may have misunderstood some things.
Cheers,
Jess