diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2024-12-25 00:34:42 +0100 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2024-12-29 19:54:53 +0100 |
| commit | 1762c56956bafd6fc0636516b494dfa935ff8aec (patch) | |
| tree | 5b693c0c70400b71c982401fd9693a48991d3c23 /usr/space_light/src/stubs/stubs.c | |
| parent | 40404fb81dfad3f5c5cf567bb053796a9135165e (diff) | |
| download | wb3s-ble-nebula-galaxy-1762c56956bafd6fc0636516b494dfa935ff8aec.tar.gz wb3s-ble-nebula-galaxy-1762c56956bafd6fc0636516b494dfa935ff8aec.zip | |
space_light: first version
TODO: pwm initialization is currently best guess
could be wrong active low|high
TODO: implement pairing
TODO: implement timer
TODO: use the button for something
TODO: implement a better client
Diffstat (limited to 'usr/space_light/src/stubs/stubs.c')
| -rw-r--r-- | usr/space_light/src/stubs/stubs.c | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/usr/space_light/src/stubs/stubs.c b/usr/space_light/src/stubs/stubs.c new file mode 100644 index 0000000..dcb79b9 --- /dev/null +++ b/usr/space_light/src/stubs/stubs.c @@ -0,0 +1,133 @@ +// stubs +#include "sk_intf.h" +#include "wlan_ui_pub.h" + +// from wlan_ui.c +static monitor_data_cb_t g_bcn_cb = 0; +monitor_data_cb_t g_monitor_cb = 0; +int g_set_channel_postpone_num = 0; + +int bk_wlan_is_monitor_mode(void) { return (0 == g_monitor_cb) ? false : true; } + +monitor_data_cb_t bk_wlan_get_bcn_cb(void) { return g_bcn_cb; } + +monitor_data_cb_t bk_wlan_get_monitor_cb(void) { + if (g_monitor_cb) { + return g_monitor_cb; + } else { + return NULL; + } +} + +int bk_wlan_is_general_sniffer_type(void) { + return false; //(MTR_GENERAL_SNIFFER_TYPE == g_monitor_type); +} + +uint32_t bk_sta_cipher_is_open(void) { + // ASSERT(g_sta_param_ptr); + return false; //(SECURITY_TYPE_NONE == g_sta_param_ptr->cipher_suite); +} + +int bk_wlan_dtim_rf_ps_mode_do_wakeup() { + // void *sem_list = NULL; + + UINT32 ret = 0; +#if 0 + sem_list = power_save_rf_ps_wkup_semlist_create(); + + if (!sem_list) + { + os_printf("err ---- NULL\r\n"); + ASSERT(0); + } + + GLOBAL_INT_DECLARATION(); + GLOBAL_INT_DISABLE(); + + if((power_save_if_ps_rf_dtim_enabled() + && power_save_if_rf_sleep()) || ble_switch_mac_sleeped) + { + power_save_rf_ps_wkup_semlist_wait(sem_list); + } + else + { + power_save_rf_ps_wkup_semlist_destroy(sem_list); + os_free(sem_list); + sem_list = NULL; + } + + GLOBAL_INT_RESTORE(); + + power_save_rf_ps_wkup_semlist_get(sem_list); +#endif + return ret; +} + +void bk_wlan_ap_set_channel_config(uint8_t channel) { + // g_ap_param_ptr->chann = channel; +} + +UINT32 if_other_mode_rf_sleep(void) { return false; } + +int bk_wlan_mcu_suppress_and_sleep(UINT32 sleep_ticks) { return 0; } + +// from wpa_ie.c +struct wpa_ie_data; + +int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len, + struct wpa_ie_data *data) { +#if 0 + if (wpa_ie_len >= 1 && wpa_ie[0] == WLAN_EID_RSN) + return wpa_parse_wpa_ie_rsn(wpa_ie, wpa_ie_len, data); + if (wpa_ie_len >= 6 && wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC && + wpa_ie[1] >= 4 && WPA_GET_BE32(&wpa_ie[2]) == OSEN_IE_VENDOR_TYPE) + return wpa_parse_wpa_ie_rsn(wpa_ie, wpa_ie_len, data); + else + return wpa_parse_wpa_ie_wpa(wpa_ie, wpa_ie_len, data); +#endif + return 0; +} + +// from sk_intf.c +int ke_mgmt_packet_tx(unsigned char *buf, int len, int flag) { + int ret = 0; + +#if 0 + int ret, poll_flag = 0; + SOCKET sk = mgmt_get_socket_num(flag); + + ret = ke_sk_send(sk, buf, len, flag); + if(ret) + { + poll_flag = wpa_hostapd_queue_poll((uint32_t)flag); + } + + if(poll_flag) + { + handle_dummy_read(sk, NULL, NULL); + } +#endif + return ret; +} + +// from pbuf.c +u8_t pbuf_free(struct pbuf *p) { return 0; } + +void pbuf_chain(struct pbuf *h, struct pbuf *t) {} + +struct pbuf *pbuf_dechain(struct pbuf *p) { return NULL; } + +struct pbuf *pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) { + return NULL; +} + +// from rwnx.h +void rwnxl_init(void) {} + +// compiler experiments: can be removed + +int secret_int = 0; + +int *get_that_int(void) { return &secret_int; } + +void change_that_int(int a) { secret_int = a; } |
