fix(dataman): widen client IDs to 16 bit (#28944)

Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
This commit is contained in:
Saibernard authored and GitHub committed 2026-10-20 08:23:31 +02:00
1 parent 30d778e28c
commit 7efdb01978
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
uint64 timestamp # time since system start (microseconds)
uint8 client_id
uint16 client_id
uint8 request_type # id/read/write/clear
uint8 item # dm_item_t
uint32 index
+1 -1
View File
@@ -1,6 +1,6 @@
uint64 timestamp # time since system start (microseconds)
uint8 client_id
uint16 client_id
uint8 request_type # id/read/write/clear
uint8 item # dm_item_t
uint32 index
+2 -2
View File
@@ -199,9 +199,9 @@ private:
px4_pollfd_struct_t _fds;
static constexpr uint8_t CLIENT_ID_NOT_SET{0};
static constexpr uint16_t CLIENT_ID_NOT_SET{0};
uint8_t _client_id{CLIENT_ID_NOT_SET};
uint16_t _client_id{CLIENT_ID_NOT_SET};
perf_counter_t _sync_perf{nullptr};
};
+2 -2
View File
@@ -150,7 +150,7 @@ static constexpr size_t g_per_item_size_with_hdr[DM_KEY_NUM_KEYS] = {
/* Table of offset for index 0 of each item type */
static unsigned int g_key_offsets[DM_KEY_NUM_KEYS];
static uint8_t dataman_clients_count = 1;
static uint16_t dataman_clients_count = 1;
static perf_counter_t _dm_read_perf{nullptr};
static perf_counter_t _dm_write_perf{nullptr};
@@ -752,7 +752,7 @@ task_main(int argc, char *argv[])
switch (request.request_type) {
case DM_GET_ID:
if (dataman_clients_count < UINT8_MAX) {
if (dataman_clients_count < UINT16_MAX) {
response.client_id = dataman_clients_count++;
/* Send the timestamp of the request over the data buffer so that the "dataman client"
* can distinguish whether the request was made by it. */