/* Loxmock - Mocked Loxone functions for functional development/testing on console-level Andrej Konkow, 2026/04, v01 Parts not being used can be ignored In case you have testing code yourself you may add some specifics to your code. CONSOLE is only defined by loxmock #ifdef CONSOLE my great console testing code #endif ********************************************************************** * The following section is for declaration of testdata and mock behaviour */ #define LOXMOCK_PRINTCALLS 1 /* Shall loxmock print the debug output? 0/1 */ #define LOXMOCK_EXECUTE_SLEEP 0 /* Shall loxmock execute the sleep-statements or run through? 0/1 */ #define LOXMOCK_LOCAL_TZDIFF_TO_UTC (+2) /* in case of using timefunctions you may adjust this one */ #define LOXMOCK_LOCAL_IS_SUMMERTIME 1 /* in case of using timefunctions you may adjust this one: 0/1 */ /* textinput channels of program block Be aware that quotation marks inside of a string have to be quoted: \" */ char *loxmock_in_char[3] = { /* text input 1 */ "", /* text input 2 */ "", /* text input 3 */ "" }; float loxmock_in_float[13] = { /* float input 1 */ 0, /* float input 2 */ 0, /* float input 3 */ 0, /* float input 4 */ 0, /* float input 5 */ 0, /* float input 6 */ 0, /* float input 7 */ 0, /* float input 8 */ 0, /* float input 9 */ 0, /* float input 10 */ 0, /* float input 11 */ 0, /* float input 12 */ 0, /* float input 13 */ 0 }; /* Result string being returned when calling httpget() Be aware that quotation marks inside of a string have to be quoted: \" */ char *loxmock_result_httpget = ""; /* When working with streams define the expected resultstream(completely). Even when your code is reading chunks loxmock will take care about that. The hex-values will be properly converted to their corresponding byte values Examples: #define LOXMOCK_STREAM lm_hexbytes char *loxmock_result_stream = "1A 4B 0C 5D"; or without whitespaces "1A4B0C5D"; #define LOXMOCK_STREAM lm_ascii char *loxmock_result_stream = "This is handled as char-stream"; Specify whether the specified stream is a - ascii-string: lm_ascii - list of hex-bytes: lm_hexbytes */ #define LOXMOCK_STREAM lm_hexbytes char *loxmock_result_stream = ""; /* Result string being returned when calling localwebservice() Be aware that quotation marks inside of a string have to be quoted: \" */ char *loxmock_result_localwebservice = ""; /* When working with virtual inputs/outputs (getio() and setio()) you can use the following map. Define the virtual input names and their corresponding initial values. */ #define LOXMOCK_VIRTUAL_BLOCKS 4 /* define the size of the map below */ typedef struct loxmock_virtual_block { char *key; float value; } loxmock_virtual_block; loxmock_virtual_block loxmock_vblocks[LOXMOCK_VIRTUAL_BLOCKS]; loxmock_vblocks[0].key = "VI0"; loxmock_vblocks[0].value = 0; loxmock_vblocks[1].key = "VI1"; loxmock_vblocks[1].value = 0; loxmock_vblocks[2].key = "VI38"; loxmock_vblocks[2].value = 0; loxmock_vblocks[3].key = "anyname"; loxmock_vblocks[3].value = 0; /* When calling getinputevent() this bitmask will be returned once and then will be set back to 0 Just for clarification: The string will be converted into a real bitmap. ;-) channels "I13 I12 I11 I10 I9 I8 I7 I6 I5 I4 I3 I2 I1 T3 T2 T1" 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 loxmox_inputevent_bitmask = "0000000000010101"; (2*8Bit) */ char *loxmox_inputevent_bitmask = "0000000000000000"; /* End of testdata section ******************************************************************************/ #include "loxmock_func_v01.c"