Skip to content

Commit

Permalink
Add static ip for bl602 (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
giedriuslt committed Mar 29, 2024
1 parent 52aba73 commit 76311b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/driver/drv_ssdp.c
Expand Up @@ -63,7 +63,7 @@ typedef struct OBK_DEVICE_tag{
int timeout; // seconds
} OBK_DEVICE;

OBK_DEVICE obkDevices[MAX_OBK_DEVICES];
static OBK_DEVICE obkDevices[MAX_OBK_DEVICES];

static void obkDeviceTick(uint32_t ip){
int i;
Expand Down
8 changes: 7 additions & 1 deletion src/hal/bl602/hal_wifi_bl602.c
Expand Up @@ -26,8 +26,14 @@ static void (*g_wifiStatusCallback)(int code);
void HAL_ConnectToWiFi(const char *ssid, const char *psk, obkStaticIP_t *ip)
{
wifi_interface_t wifi_interface;

if (ip->localIPAddr[0] == 0) {
wifi_mgmr_sta_ip_unset();
}
else {
wifi_mgmr_sta_ip_set(*(int*)ip->localIPAddr, *(int*)ip->netMask, *(int*)ip->gatewayIPAddr, *(int*)ip->dnsServerIpAddr, 0);
}
wifi_interface = wifi_mgmr_sta_enable();

wifi_mgmr_sta_connect(wifi_interface, ssid, psk, NULL, NULL, 0, 0);

g_bAccessPointMode = 0;
Expand Down

0 comments on commit 76311b7

Please sign in to comment.