py_nl2telemetry | simple implementation of a telemetry client | Parser library
kandi X-RAY | py_nl2telemetry Summary
kandi X-RAY | py_nl2telemetry Summary
A simple implementation of a telemetry client for communication with the telemetry server of NoLimits 2 - Roller Coaster Simulation
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run the main station .
- collects data from nl2
- Initializes the button .
- Set the attributes .
- Saves collected data .
- Test the GUI .
- Start the background plot .
- Set the status of the button .
- Toggle the flight of this station .
- Collect data from the server
py_nl2telemetry Key Features
py_nl2telemetry Examples and Code Snippets
Community Discussions
Trending Discussions on py_nl2telemetry
QUESTION
I'm trying to communicate with a server running locally on my machine. I just don't know how to write the message the sever expects. I'm trying to do this on a .Net application (C#). This server expects an at least 10 byte message arranged by the following structure, from the manual:
[Full manual] http://jkca.ca/help/pages/telemetry.html#messageformat
Each message has the same basic binary format. All multi-byte values are in network-byte-order (big-endian)!! The minimum message size is 10 bytes. Clients are allowed to send Client Request messages (see Message Type Table). The server will respond with corresponding Server Reply messages. The Request ID can be freely assigned by the client and has no special meaning. The server's reply message will use the same Request ID in the corresponding answer.
(I seem to be unable to format a table in this question so I'm omitting the table that can be found in the manual)
I would like to understand how to form these messages. If anyone could explain to a non CS student how to form, for example, the message to send a "pause command" (http://jkca.ca/help/pages/telemetry.html#msg27) that would be super useful.
I've tried all sorts of variations of:
...ANSWER
Answered 2022-Jan-11 at 00:09To expand on Hans' comment, each letter in a string literal usually equates to one byte. E.g. A
is stored as 0x41
, B
is stored as 0x42
, 0
is stored as 0x30
. Search for ASCII and UTF8 character encodings for more info. When you write a string like '1000', then get the underlying bytes, you end up with the sequence 0x31 0x30 0x30 0x30
. The number of bytes here is equal to the number of digits in your string. This is a variable-length number, and it's not a very compact way to store the information, because instead of using the full range of each byte (00 to FF) for a total of 256 possibilities per byte, it only uses 10 of the possibilities (30 to 39). This inefficiency becomes more obvious when you use larger numbers, e.g. 1000000 takes up 7 bytes.
The server is expecting the request id in a different format, int32
, which always takes up 4 bytes. You can get the data into this format by calling BinaryPrimitives.WriteInt32BigEndian(buffer, 1000)
. The same applies for the message type id and the data size fields, they should be provided as Int16.
After reading the documentation you posted, it looks like the expected data for a 'Set Pause' request would be like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install py_nl2telemetry
You can use py_nl2telemetry like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page