I'm sending this to the server:
import requests
response = requests.get('http://SERVER-IP/get.cgi?req=zones')
print(response.content)
I get back a string of data like this:
b'CS\x01\x00\x00\x00\x01\x00MainAuditorium\x00\x00\x00\x00\x01\x00\x03\x00\x00\x00\x01\x00\x00\x00'
On the website it lists a variable length structure
typedef struct ZonesData {
uint16_t signature; // Signature = 'CS'
int16_t version; // Version = 0x0001 (or negative error code)
uint8_t reserved[2]; // -
uint16_t zoneCount; // Number of zones
ZoneRecord zones[]; // Variable array of zone records
} ZonesData;
#define STACK_NAME_BUF_SIZE 16
typedef struct ZoneRecord {
char name[STACK_NAME_BUF_SIZE]; // Name of zone
uint8_t playbackIndex; // Playback index
uint8_t joinGroup; // Join group
uint16_t count; // Number of PresetID/Status pairs
uint32_t data[]; // Array of PresetID/Status pairs (32 pairs max)
} ZoneRecord;
How can I get python to put the code in Human readable form?
Can a use the returned integers to say update a button on a UI? I'm assuming I can, I'm just not sure if I would reference to integer or the human readable of the integer.
Additonal project context: I am trying to get Qsys and Cueserver integrated so that Qsys touchpad buttons update when a new preset is fired from a Cueserver wall station.
My brother-in-law and I worked on it some this weekend he came up with this.... I am still working out exactly what he did so that i can modify it for additional responses. You can ask the server for a bunch of different strings back (all in the same raw format). Looks like I'll have to code an individual response for each one...