5 #define debug_print(...) //fprintf(stderr, __VA_ARGS__)
7 void ${module_callback("test_callback", argformat="65B")} (const comm_callback_descriptor* cb, void* argbuf_end){
8 uint8_t* args = (uint8_t*) cb->argbuf;
9 for(uint8_t* i = args; i<(uint8_t*)argbuf_end; i++){
11 debug_print("Wrong byte in argument buffer at position 0x%x. Expected 0x41, got 0x%x\n", i, *i);
17 ${modulevar("test_buffer", "uint8_t", "257B", array=257)};
19 void ${module_callback("check_test_buffer")} (const comm_callback_descriptor* cb, void* argbuf_end){
20 for(unsigned int i=0; i<sizeof(${modulevar("test_buffer")}); i++){
21 uint8_t expected = 'A' + (i/32);
22 if(${modulevar("test_buffer")}[i] != expected){
23 debug_print("Wrong byte in the test buffer at position %d. Expected 0x%x, got 0x%x\n", i, expected, ${modulevar("test_buffer")}[i]);
29 void ${module_callback("test_callback_long_args", argformat="257B")} (const comm_callback_descriptor* cb, void* argbuf_end){
30 uint8_t* args = (uint8_t*)cb->argbuf;
31 for(uint8_t* i = args; i < (uint8_t*)argbuf_end; i++){
33 debug_print("Wrong byte in argument buffer. Expected 0x41, got 0x%x\n", *i);
37 uint16_t argsize = (uint8_t*)argbuf_end - args;
39 debug_print("Wrong argument size. Expected 257, got %d\n", argsize);