1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 5 #include "py/builtin.h" 6 #include "py/mperrno.h" 7 #include "py/obj.h" 8 #include "py/runtime.h" 9 #include "ulog/ulog.h" 10 11 extern const mp_obj_type_t mqtt_client_type; 12 13 // this is the actual C-structure for our new object 14 15 STATIC const mp_rom_map_elem_t mqtt_locals_dict_table[] = { 16 { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_http) }, 17 { MP_OBJ_NEW_QSTR(MP_QSTR_client), MP_ROM_PTR(&mqtt_client_type) }, 18 19 }; 20 21 STATIC MP_DEFINE_CONST_DICT(mqtt_locals_dict, mqtt_locals_dict_table); 22 23 const mp_obj_module_t mqtt_module = { 24 .base = { &mp_type_module }, 25 .globals = (mp_obj_dict_t *)&mqtt_locals_dict, 26 }; 27