2021-11-22 11:24:16 +00:00
|
|
|
/**
|
|
|
|
* @file network.h
|
|
|
|
* @author Sergey Gavrilov (who.just.the.doctor@gmail.com)
|
|
|
|
* @version 1.0
|
|
|
|
* @date 2021-11-21
|
|
|
|
*
|
|
|
|
* Network API
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#define ESP_WIFI_MODE_STA "STA"
|
|
|
|
#define ESP_WIFI_MODE_AP "AP"
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
WIFIModeSTA,
|
|
|
|
WIFIModeAP,
|
|
|
|
} WIFIMode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init network module
|
|
|
|
* @return WIFIMode
|
|
|
|
*/
|
|
|
|
WIFIMode network_init(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns current WIFI mode
|
|
|
|
* @return WIFIMode
|
|
|
|
*/
|
2021-11-30 05:27:56 +00:00
|
|
|
WIFIMode network_get_mode(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get current IP address
|
|
|
|
* @return uint32_t
|
|
|
|
*/
|
|
|
|
uint32_t network_get_ip(void);
|