You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been digging into this library and trying to write a new function to handle 'double' or 'float' data types. Right now the best I have is writing and reading the float variable as a char buffer. I have this reading and writing out, however, this doesn't seem to allow me to modify the actual variable when mapped through 'static struct cat_variable'. I set up a new type CAT_VAR_NUM_DOUBLE to handle it.
My question is when storing the float variable as a char buffer, is there a method I can call to update the float variable directly as a char buffer? Or if my current approach does not make sense, maybe you can point me in a new direction?
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
I've been digging into this library and trying to write a new function to handle 'double' or 'float' data types. Right now the best I have is writing and reading the float variable as a char buffer. I have this reading and writing out, however, this doesn't seem to allow me to modify the actual variable when mapped through 'static struct cat_variable'. I set up a new type CAT_VAR_NUM_DOUBLE to handle it.
static struct cat_variable go_vars[] = { { .type = CAT_VAR_NUM_DOUBLE, .data = &global.x, .data_size = sizeof(global.x), .write = x_write, .name = "x", .access = CAT_VAR_ACCESS_READ_WRITE }, }
I have global.x defined as the following in order to not truncate the data I send.
typedef struct { double x[16]; } GlobalControl;
My parsing of the write arguments is:
`static int parse_num_double(struct cat_object *self)
{
assert(self != NULL);
char ch;
int state = 0;
size_t size = 0;
}`
My question is when storing the float variable as a char buffer, is there a method I can call to update the float variable directly as a char buffer? Or if my current approach does not make sense, maybe you can point me in a new direction?
Thanks!
The text was updated successfully, but these errors were encountered: