mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-03-30 14:15:39 +00:00
Merge pull request #5 from scotty007/fix/announce-format
Fix msgpack format of announce app data
This commit is contained in:
@@ -134,11 +134,12 @@ static RNS::Bytes encodeAnnounceName(const String& name) {
|
||||
if (name.isEmpty()) return {};
|
||||
size_t len = name.length();
|
||||
if (len > 31) len = 31;
|
||||
uint8_t buf[2 + 31];
|
||||
uint8_t buf[3 + 31];
|
||||
buf[0] = 0x91; // msgpack fixarray(1)
|
||||
buf[1] = 0xA0 | (uint8_t)len; // msgpack fixstr(len)
|
||||
memcpy(buf + 2, name.c_str(), len);
|
||||
return RNS::Bytes(buf, 2 + len);
|
||||
buf[1] = 0xC4; // msgpack bin 8
|
||||
buf[2] = (uint8_t)len; // bin len
|
||||
memcpy(buf + 3, name.c_str(), len);
|
||||
return RNS::Bytes(buf, 3 + len);
|
||||
}
|
||||
|
||||
static void announceWithName() {
|
||||
|
||||
Reference in New Issue
Block a user