1 #include "core_sysdep.h" 2 3 static aiot_sysdep_portfile_t *g_sysdep_portfile = NULL; 4 aiot_sysdep_set_portfile(aiot_sysdep_portfile_t * portfile)5void aiot_sysdep_set_portfile(aiot_sysdep_portfile_t *portfile) 6 { 7 g_sysdep_portfile = portfile; 8 } 9 aiot_sysdep_get_portfile(void)10aiot_sysdep_portfile_t * aiot_sysdep_get_portfile(void) 11 { 12 if (g_sysdep_portfile == NULL || 13 g_sysdep_portfile->core_sysdep_malloc == NULL || 14 g_sysdep_portfile->core_sysdep_free == NULL || 15 g_sysdep_portfile->core_sysdep_time == NULL || 16 g_sysdep_portfile->core_sysdep_sleep == NULL || 17 g_sysdep_portfile->core_sysdep_network_init == NULL || 18 g_sysdep_portfile->core_sysdep_network_setopt == NULL || 19 g_sysdep_portfile->core_sysdep_network_establish == NULL || 20 g_sysdep_portfile->core_sysdep_network_recv == NULL || 21 g_sysdep_portfile->core_sysdep_network_send == NULL || 22 g_sysdep_portfile->core_sysdep_network_deinit == NULL || 23 g_sysdep_portfile->core_sysdep_rand == NULL || 24 g_sysdep_portfile->core_sysdep_mutex_init == NULL || 25 g_sysdep_portfile->core_sysdep_mutex_lock == NULL || 26 g_sysdep_portfile->core_sysdep_mutex_unlock == NULL || 27 g_sysdep_portfile->core_sysdep_mutex_deinit == NULL) { 28 return NULL; 29 } 30 return g_sysdep_portfile; 31 } 32 33