mirror of https://github.com/ARMmbed/mbed-os.git
Update COMPONENT_SCL
parent
2148fa5ab9
commit
d9655da2e8
|
@ -32,14 +32,16 @@
|
||||||
/** @file
|
/** @file
|
||||||
* Provides SCL interface functions to be used with WiFiInterface or NetworkInterface Objects
|
* Provides SCL interface functions to be used with WiFiInterface or NetworkInterface Objects
|
||||||
*/
|
*/
|
||||||
|
#define MIN_SSID_LENGTH (0)
|
||||||
|
#define MIN_PASSWORD_LENGTH (0)
|
||||||
|
|
||||||
struct scl_tx_nw_credentials {
|
struct scl_tx_net_credentials {
|
||||||
nsapi_security_t network_security_type;
|
nsapi_security_t network_security_type;
|
||||||
int ssid_len;
|
int ssid_len;
|
||||||
int pass_len;
|
int pass_len;
|
||||||
const char *network_ssid;
|
const char *network_ssid;
|
||||||
const char *network_passphrase;
|
const char *network_passphrase;
|
||||||
} scl_tx_nw_credentials_t;
|
} scl_tx_network_credentials;
|
||||||
|
|
||||||
network_params_t network_parameter;
|
network_params_t network_parameter;
|
||||||
|
|
||||||
|
@ -177,20 +179,24 @@ nsapi_error_t SclSTAInterface::connect()
|
||||||
nsapi_error_t interface_status;
|
nsapi_error_t interface_status;
|
||||||
uint32_t connection_status = 0;
|
uint32_t connection_status = 0;
|
||||||
|
|
||||||
scl_tx_nw_credentials_t.network_ssid = _ssid;
|
scl_tx_network_credentials.network_ssid = _ssid;
|
||||||
if (strlen(_ssid) < MAX_SSID_LENGTH) {
|
if ((strlen(_ssid) < MAX_SSID_LENGTH) && (strlen(_ssid) > MIN_SSID_LENGTH)) {
|
||||||
scl_tx_nw_credentials_t.ssid_len = strlen(_ssid);
|
scl_tx_network_credentials.ssid_len = strlen(_ssid);
|
||||||
|
} else {
|
||||||
|
return NSAPI_ERROR_PARAMETER;
|
||||||
}
|
}
|
||||||
scl_tx_nw_credentials_t.network_passphrase = _pass;
|
scl_tx_network_credentials.network_passphrase = _pass;
|
||||||
if (strlen(_pass) < MAX_PASSWORD_LENGTH) {
|
if (((strlen(_pass) < MAX_PASSWORD_LENGTH) && (strlen(_pass) > MIN_PASSWORD_LENGTH)) || (_security == NSAPI_SECURITY_NONE)) {
|
||||||
scl_tx_nw_credentials_t.pass_len = strlen(_pass);
|
scl_tx_network_credentials.pass_len = strlen(_pass);
|
||||||
|
} else {
|
||||||
|
return NSAPI_ERROR_PARAMETER;
|
||||||
}
|
}
|
||||||
scl_tx_nw_credentials_t.network_security_type = _security;
|
scl_tx_network_credentials.network_security_type = _security;
|
||||||
|
|
||||||
ret_val = scl_send_data(SCL_TX_CONNECT, (char *)&scl_tx_nw_credentials_t, TIMER_DEFAULT_VALUE);
|
ret_val = scl_send_data(SCL_TX_CONNECT, (char *)&scl_tx_network_credentials, TIMER_DEFAULT_VALUE);
|
||||||
|
|
||||||
if (ret_val == SCL_SUCCESS) {
|
if (ret_val == SCL_SUCCESS) {
|
||||||
SCL_LOG(("wifi provisioning in progress"));
|
SCL_LOG(("wifi provisioning in progress\r\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
network_parameter.connection_status = NSAPI_STATUS_DISCONNECTED;
|
network_parameter.connection_status = NSAPI_STATUS_DISCONNECTED;
|
||||||
|
@ -230,7 +236,9 @@ nsapi_error_t SclSTAInterface::connect()
|
||||||
network_parameter.gateway,
|
network_parameter.gateway,
|
||||||
DEFAULT_STACK);
|
DEFAULT_STACK);
|
||||||
|
|
||||||
scl_send_data(SCL_TX_CONNECTION_STATUS, (char *)&connection_status, TIMER_DEFAULT_VALUE);
|
if (interface_status == NSAPI_ERROR_OK) {
|
||||||
|
scl_send_data(SCL_TX_CONNECTION_STATUS, (char *)&connection_status, TIMER_DEFAULT_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
return interface_status;
|
return interface_status;
|
||||||
}
|
}
|
||||||
|
@ -246,6 +254,8 @@ nsapi_error_t SclSTAInterface::disconnect()
|
||||||
{
|
{
|
||||||
scl_result_t ret_val;
|
scl_result_t ret_val;
|
||||||
nsapi_error_t disconnect_status;
|
nsapi_error_t disconnect_status;
|
||||||
|
uint32_t delay_timeout = 0;
|
||||||
|
|
||||||
ret_val = scl_send_data(SCL_TX_DISCONNECT, (char *)&disconnect_status, TIMER_DEFAULT_VALUE);
|
ret_val = scl_send_data(SCL_TX_DISCONNECT, (char *)&disconnect_status, TIMER_DEFAULT_VALUE);
|
||||||
|
|
||||||
if (ret_val == SCL_ERROR) {
|
if (ret_val == SCL_ERROR) {
|
||||||
|
@ -253,7 +263,18 @@ nsapi_error_t SclSTAInterface::disconnect()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_interface) {
|
if (!_interface) {
|
||||||
return NSAPI_STATUS_DISCONNECTED;
|
return NSAPI_ERROR_NO_CONNECTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
// block till disconnected from network
|
||||||
|
while ((network_parameter.connection_status != NSAPI_STATUS_DISCONNECTED) && delay_timeout < NW_DISCONNECT_TIMEOUT) {
|
||||||
|
ret_val = scl_get_nw_parameters(&network_parameter);
|
||||||
|
wait_us(NW_DELAY_TIME_US);
|
||||||
|
delay_timeout++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (delay_timeout >= NW_DISCONNECT_TIMEOUT) {
|
||||||
|
return NSAPI_ERROR_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bring down
|
// bring down
|
||||||
|
|
|
@ -89,8 +89,11 @@ void SCL_EMAC::power_down()
|
||||||
bool SCL_EMAC::power_up()
|
bool SCL_EMAC::power_up()
|
||||||
{
|
{
|
||||||
if (!powered_up) {
|
if (!powered_up) {
|
||||||
if (scl_wifi_on() != true) {
|
#ifdef MBED_TEST_MODE
|
||||||
SCL_LOG(("returning False in scl_wifi_on()\n"));
|
scl_init();
|
||||||
|
#endif
|
||||||
|
if (!scl_wifi_on()) {
|
||||||
|
SCL_LOG(("WiFi failed to turn on\r\n"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
powered_up = true;
|
powered_up = true;
|
||||||
|
@ -109,10 +112,9 @@ bool SCL_EMAC::get_hwaddr(uint8_t *addr) const
|
||||||
memcpy(addr, mac.octet, sizeof(mac.octet));
|
memcpy(addr, mac.octet, sizeof(mac.octet));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("return False in SCL_EMAC::gethwaddr\n"));
|
SCL_LOG(("Unable to get MAC address\r\n"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCL_EMAC::set_hwaddr(const uint8_t *addr)
|
void SCL_EMAC::set_hwaddr(const uint8_t *addr)
|
||||||
|
@ -150,7 +152,8 @@ bool SCL_EMAC::link_out(emac_mem_buf_t *buf)
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
retval = scl_network_send_ethernet_data(scl_tx_data);
|
|
||||||
|
retval = scl_network_send_ethernet_data(scl_tx_data); //Buffer is copied on Network Processor
|
||||||
if (retval != SCL_SUCCESS) {
|
if (retval != SCL_SUCCESS) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @file scl_common.h
|
/** @file scl_common.h
|
||||||
* Defines common data types used in SCL
|
* Defines common data types used in SCL
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -53,6 +53,10 @@ extern "C"
|
||||||
* Default timeout value (in seconds) for Wi-Fi connection
|
* Default timeout value (in seconds) for Wi-Fi connection
|
||||||
*/
|
*/
|
||||||
#define NW_CONNECT_TIMEOUT (30)
|
#define NW_CONNECT_TIMEOUT (30)
|
||||||
|
/**
|
||||||
|
* Default timeout value (in seconds) for Wi-Fi disconnection
|
||||||
|
*/
|
||||||
|
#define NW_DISCONNECT_TIMEOUT (30)
|
||||||
/**
|
/**
|
||||||
* Default interval (in micro seconds) for polling the Network Processor
|
* Default interval (in micro seconds) for polling the Network Processor
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* Provides SCL functionality to communicate with Network Processor
|
* Provides SCL functionality to communicate with Network Processor
|
||||||
*/
|
*/
|
||||||
|
@ -40,6 +41,7 @@
|
||||||
#define DELAY_TIME (1000)
|
#define DELAY_TIME (1000)
|
||||||
#define SEMAPHORE_MAXCOUNT (1)
|
#define SEMAPHORE_MAXCOUNT (1)
|
||||||
#define SEMAPHORE_INITCOUNT (0)
|
#define SEMAPHORE_INITCOUNT (0)
|
||||||
|
#define INTIAL_VALUE (0)
|
||||||
/******************************************************
|
/******************************************************
|
||||||
** Function Declarations
|
** Function Declarations
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
|
@ -55,13 +57,13 @@ scl_result_t scl_init(void);
|
||||||
* Variables Definitions
|
* Variables Definitions
|
||||||
*****************************************************/
|
*****************************************************/
|
||||||
/* Structure of SCL thread info
|
/* Structure of SCL thread info
|
||||||
* scl_thread_quit_flag: flag used to determine if thread is to be quit
|
|
||||||
* scl_inited: flag used to determine if thread is started
|
* scl_inited: flag used to determine if thread is started
|
||||||
* scl_thread: variable for thread handle
|
* scl_thread_quit_flag: flag used to determine if thread is to be quit
|
||||||
* scl_thread_stack_start: pointer to start of thread stack
|
* scl_thread_stack_start: pointer to start of thread stack
|
||||||
|
* scl_thread: variable for thread handle
|
||||||
|
* scl_rx_ready: semaphore for blocking the thread
|
||||||
* scl_thread_stack_size: size of thread stack
|
* scl_thread_stack_size: size of thread stack
|
||||||
* scl_thread_priority: priority of thread
|
* scl_thread_priority: priority of thread
|
||||||
* scl_rx_ready: semaphore for blocking the thread
|
|
||||||
*/
|
*/
|
||||||
struct scl_thread_info_t {
|
struct scl_thread_info_t {
|
||||||
volatile scl_bool_t scl_inited;
|
volatile scl_bool_t scl_inited;
|
||||||
|
@ -113,9 +115,10 @@ static void scl_config(void)
|
||||||
*/
|
*/
|
||||||
static scl_result_t scl_thread_init(void)
|
static scl_result_t scl_thread_init(void)
|
||||||
{
|
{
|
||||||
cy_rslt_t retval, tmp = 0;
|
cy_rslt_t retval = CY_RSLT_SUCCESS;
|
||||||
|
cy_rslt_t tmp = INTIAL_VALUE;
|
||||||
memset(&g_scl_thread_info, 0, sizeof(g_scl_thread_info));
|
memset(&g_scl_thread_info, 0, sizeof(g_scl_thread_info));
|
||||||
g_scl_thread_info.scl_thread_stack_start = (uint8_t *) malloc(SCL_THREAD_STACK_SIZE);;
|
g_scl_thread_info.scl_thread_stack_start = (uint8_t *) malloc(SCL_THREAD_STACK_SIZE);
|
||||||
g_scl_thread_info.scl_thread_stack_size = (uint32_t) SCL_THREAD_STACK_SIZE;
|
g_scl_thread_info.scl_thread_stack_size = (uint32_t) SCL_THREAD_STACK_SIZE;
|
||||||
g_scl_thread_info.scl_thread_priority = (cy_thread_priority_t) SCL_THREAD_PRIORITY;
|
g_scl_thread_info.scl_thread_priority = (cy_thread_priority_t) SCL_THREAD_PRIORITY;
|
||||||
|
|
||||||
|
@ -141,7 +144,7 @@ static scl_result_t scl_thread_init(void)
|
||||||
scl_result_t scl_init(void)
|
scl_result_t scl_init(void)
|
||||||
{
|
{
|
||||||
scl_result_t retval = SCL_SUCCESS;
|
scl_result_t retval = SCL_SUCCESS;
|
||||||
uint32_t configuration_parameters = 0;
|
uint32_t configuration_parameters = INTIAL_VALUE;
|
||||||
#ifdef MBED_CONF_TARGET_NP_CLOUD_DISABLE
|
#ifdef MBED_CONF_TARGET_NP_CLOUD_DISABLE
|
||||||
configuration_parameters = (MBED_CONF_TARGET_NP_CLOUD_DISABLE << 1);
|
configuration_parameters = (MBED_CONF_TARGET_NP_CLOUD_DISABLE << 1);
|
||||||
#else
|
#else
|
||||||
|
@ -152,12 +155,12 @@ scl_result_t scl_init(void)
|
||||||
#else
|
#else
|
||||||
configuration_parameters |= false;
|
configuration_parameters |= false;
|
||||||
#endif
|
#endif
|
||||||
//SCL_LOG("configuration_parameters = %lu\n", configuration_parameters);
|
//SCL_LOG("configuration_parameters = %lu\r\n", configuration_parameters);
|
||||||
scl_config();
|
scl_config();
|
||||||
if (g_scl_thread_info.scl_inited != SCL_TRUE) {
|
if (g_scl_thread_info.scl_inited != SCL_TRUE) {
|
||||||
retval = scl_thread_init();
|
retval = scl_thread_init();
|
||||||
if (retval != SCL_SUCCESS) {
|
if (retval != SCL_SUCCESS) {
|
||||||
SCL_LOG(("Thread init failed\n"));
|
SCL_LOG(("Thread init failed\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
} else {
|
} else {
|
||||||
retval = scl_send_data(SCL_TX_CONFIG_PARAMETERS, (char *) &configuration_parameters, TIMER_DEFAULT_VALUE);
|
retval = scl_send_data(SCL_TX_CONFIG_PARAMETERS, (char *) &configuration_parameters, TIMER_DEFAULT_VALUE);
|
||||||
|
@ -173,7 +176,7 @@ scl_result_t scl_send_data(int index, char *buffer, uint32_t timeout)
|
||||||
IPC_STRUCT_Type *scl_send = NULL;
|
IPC_STRUCT_Type *scl_send = NULL;
|
||||||
uint32_t delay_timeout;
|
uint32_t delay_timeout;
|
||||||
|
|
||||||
SCL_LOG(("scl_send_data index = %d\n", index));
|
SCL_LOG(("scl_send_data index = %d\r\n", index));
|
||||||
scl_send = Cy_IPC_Drv_GetIpcBaseAddress(SCL_TX_CHANNEL);
|
scl_send = Cy_IPC_Drv_GetIpcBaseAddress(SCL_TX_CHANNEL);
|
||||||
CHECK_BUFFER_NULL(buffer);
|
CHECK_BUFFER_NULL(buffer);
|
||||||
if (!(REG_IPC_STRUCT_LOCK_STATUS(scl_send) & SCL_LOCK_ACQUIRE_STATUS)) {
|
if (!(REG_IPC_STRUCT_LOCK_STATUS(scl_send) & SCL_LOCK_ACQUIRE_STATUS)) {
|
||||||
|
@ -198,7 +201,7 @@ scl_result_t scl_send_data(int index, char *buffer, uint32_t timeout)
|
||||||
return SCL_SUCCESS;
|
return SCL_SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("unable to acquire lock\n"));
|
SCL_LOG(("unable to acquire lock\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,27 +233,22 @@ static void scl_rx_handler(void)
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
IPC_STRUCT_Type *scl_receive = NULL;
|
IPC_STRUCT_Type *scl_receive = NULL;
|
||||||
scl_buffer_t cp_buffer;
|
scl_buffer_t cp_buffer;
|
||||||
scl_buffer_t scl_buffer;
|
|
||||||
uint32_t rx_ipc_size;
|
uint32_t rx_ipc_size;
|
||||||
struct rx_ipc_info {
|
int *rx_cp_buffer;
|
||||||
uint32_t size;
|
|
||||||
int *buf_alloc;
|
|
||||||
}*rx_cp = NULL;
|
|
||||||
|
|
||||||
SCL_LOG(("Starting CP Rx thread\r\n"));
|
SCL_LOG(("Starting CP Rx thread\r\n"));
|
||||||
scl_receive = Cy_IPC_Drv_GetIpcBaseAddress(SCL_RX_CHANNEL);
|
scl_receive = Cy_IPC_Drv_GetIpcBaseAddress(SCL_RX_CHANNEL);
|
||||||
|
|
||||||
while (SCL_TRUE) {
|
while (SCL_TRUE) {
|
||||||
cy_rtos_get_semaphore(&g_scl_thread_info.scl_rx_ready, CY_RTOS_NEVER_TIMEOUT, SCL_FALSE);
|
cy_rtos_get_semaphore(&g_scl_thread_info.scl_rx_ready, CY_RTOS_NEVER_TIMEOUT, SCL_FALSE);
|
||||||
index = (uint32_t)REG_IPC_STRUCT_DATA0(scl_receive);
|
index = (uint32_t)REG_IPC_STRUCT_DATA0(scl_receive);
|
||||||
SCL_LOG(("scl_rx_handler index = %lu\n", index));
|
SCL_LOG(("scl_rx_handler index = %lu\r\n", index));
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case SCL_RX_DATA: {
|
case SCL_RX_DATA: {
|
||||||
rx_cp = (struct rx_ipc_info *) REG_IPC_STRUCT_DATA1(scl_receive);
|
SCL_LOG(("on CP the rxd address = %lx\r\n", REG_IPC_STRUCT_DATA1(scl_receive)));
|
||||||
scl_buffer = rx_cp->buf_alloc;
|
rx_cp_buffer = (int *) REG_IPC_STRUCT_DATA1(scl_receive);
|
||||||
|
SCL_LOG(("rx_cp_buffer = %p \r\n", rx_cp_buffer));
|
||||||
REG_IPC_STRUCT_RELEASE(scl_receive) = SCL_RELEASE;
|
REG_IPC_STRUCT_RELEASE(scl_receive) = SCL_RELEASE;
|
||||||
SCL_LOG(("scl_buffer = %p\n", scl_buffer));
|
scl_network_process_ethernet_data(rx_cp_buffer);
|
||||||
scl_network_process_ethernet_data(scl_buffer);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SCL_RX_TEST_MSG: {
|
case SCL_RX_TEST_MSG: {
|
||||||
|
@ -273,11 +271,11 @@ static void scl_rx_handler(void)
|
||||||
} else {
|
} else {
|
||||||
scl_emac_wifi_link_state_changed(false);
|
scl_emac_wifi_link_state_changed(false);
|
||||||
}
|
}
|
||||||
SCL_LOG(("connection status = %d\n", connection_status));
|
SCL_LOG(("connection status = %d\r\n", connection_status));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
SCL_LOG(("incorrect IPC from Network Processor\n"));
|
SCL_LOG(("incorrect IPC from Network Processor\r\n"));
|
||||||
REG_IPC_STRUCT_RELEASE(scl_receive) = SCL_RELEASE;
|
REG_IPC_STRUCT_RELEASE(scl_receive) = SCL_RELEASE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,10 +36,6 @@ extern "C"
|
||||||
/******************************************************
|
/******************************************************
|
||||||
* Constants
|
* Constants
|
||||||
******************************************************/
|
******************************************************/
|
||||||
/**
|
|
||||||
* Size of the SDIO block
|
|
||||||
*/
|
|
||||||
#define SDIO_BLOCK_SIZE (64U)
|
|
||||||
|
|
||||||
/******************************************************
|
/******************************************************
|
||||||
* Macros
|
* Macros
|
||||||
|
|
|
@ -45,10 +45,9 @@ scl_result_t scl_host_buffer_get(scl_buffer_t *buffer, scl_buffer_dir_t directio
|
||||||
if ((direction == SCL_NETWORK_TX) && (size <= PBUF_POOL_BUFSIZE)) {
|
if ((direction == SCL_NETWORK_TX) && (size <= PBUF_POOL_BUFSIZE)) {
|
||||||
p = pbuf_alloc(PBUF_RAW, size, PBUF_POOL);
|
p = pbuf_alloc(PBUF_RAW, size, PBUF_POOL);
|
||||||
} else {
|
} else {
|
||||||
p = pbuf_alloc(PBUF_RAW, size + SDIO_BLOCK_SIZE, PBUF_RAM);
|
p = pbuf_alloc(PBUF_RAW, size, PBUF_RAM);
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
p->len = size;
|
p->len = size;
|
||||||
p->tot_len -= SDIO_BLOCK_SIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
|
|
|
@ -38,7 +38,7 @@ scl_result_t scl_wifi_is_ready_to_transceive(void)
|
||||||
|
|
||||||
result = scl_send_data(SCL_TX_TRANSCEIVE_READY, (char *)&retval, TIMER_DEFAULT_VALUE);
|
result = scl_send_data(SCL_TX_TRANSCEIVE_READY, (char *)&retval, TIMER_DEFAULT_VALUE);
|
||||||
if (result == SCL_ERROR) {
|
if (result == SCL_ERROR) {
|
||||||
SCL_LOG(("Ready to tranceive error\n"));
|
SCL_LOG(("Ready to tranceive error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
} else {
|
} else {
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -51,7 +51,7 @@ bool scl_wifi_on(void)
|
||||||
scl_result_t result = SCL_SUCCESS;
|
scl_result_t result = SCL_SUCCESS;
|
||||||
result = scl_send_data(SCL_TX_WIFI_ON, (char *)&retval, WIFI_ON_TIMEOUT);
|
result = scl_send_data(SCL_TX_WIFI_ON, (char *)&retval, WIFI_ON_TIMEOUT);
|
||||||
if (result == SCL_ERROR) {
|
if (result == SCL_ERROR) {
|
||||||
SCL_LOG(("wifi_on Error\n"));
|
SCL_LOG(("wifi_on Error\r\n"));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -66,7 +66,7 @@ scl_result_t scl_wifi_set_up(void)
|
||||||
if (result == SCL_SUCCESS) {
|
if (result == SCL_SUCCESS) {
|
||||||
return retval;
|
return retval;
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("Wifi set up error\n"));
|
SCL_LOG(("Wifi set up error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ scl_result_t scl_wifi_get_mac_address(scl_mac_t *mac)
|
||||||
if (scl_retval == SCL_SUCCESS) {
|
if (scl_retval == SCL_SUCCESS) {
|
||||||
return scl_mac_data.retval;
|
return scl_mac_data.retval;
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("Get MAC address error\n"));
|
SCL_LOG(("Get MAC address error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ scl_result_t scl_wifi_get_bssid(scl_mac_t *bssid)
|
||||||
} scl_bssid_t;
|
} scl_bssid_t;
|
||||||
scl_result_t scl_retval = SCL_SUCCESS;
|
scl_result_t scl_retval = SCL_SUCCESS;
|
||||||
scl_bssid_t.bssid = bssid;
|
scl_bssid_t.bssid = bssid;
|
||||||
scl_bssid_t.retval = 0;
|
scl_bssid_t.retval = SCL_SUCCESS;
|
||||||
if (bssid == NULL) {
|
if (bssid == NULL) {
|
||||||
return SCL_BADARG;
|
return SCL_BADARG;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ scl_result_t scl_wifi_get_bssid(scl_mac_t *bssid)
|
||||||
if (scl_retval == SCL_SUCCESS) {
|
if (scl_retval == SCL_SUCCESS) {
|
||||||
return scl_bssid_t.retval;
|
return scl_bssid_t.retval;
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("get bssid error\n"));
|
SCL_LOG(("get bssid error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,14 +115,14 @@ scl_result_t scl_wifi_register_multicast_address(scl_mac_t *mac)
|
||||||
{
|
{
|
||||||
scl_mac scl_mac_t;
|
scl_mac scl_mac_t;
|
||||||
scl_mac_t.mac = mac;
|
scl_mac_t.mac = mac;
|
||||||
scl_mac_t.retval = 0;
|
scl_mac_t.retval = SCL_SUCCESS;
|
||||||
scl_result_t scl_retval = SCL_SUCCESS;
|
scl_result_t scl_retval = SCL_SUCCESS;
|
||||||
if (mac == NULL) {
|
if (mac == NULL) {
|
||||||
return SCL_BADARG;
|
return SCL_BADARG;
|
||||||
}
|
}
|
||||||
scl_retval = scl_send_data(SCL_TX_REGISTER_MULTICAST_ADDRESS, (char *)&scl_mac_t, TIMER_DEFAULT_VALUE);
|
scl_retval = scl_send_data(SCL_TX_REGISTER_MULTICAST_ADDRESS, (char *)&scl_mac_t, TIMER_DEFAULT_VALUE);
|
||||||
if (scl_retval != SCL_SUCCESS) {
|
if (scl_retval != SCL_SUCCESS) {
|
||||||
SCL_LOG(("Register Multicast Address IPC Error"));
|
SCL_LOG(("Register Multicast Address IPC Error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
return (scl_mac_t.retval);
|
return (scl_mac_t.retval);
|
||||||
|
@ -154,7 +154,7 @@ scl_result_t scl_wifi_get_rssi(int32_t *rssi)
|
||||||
if (scl_retval == SCL_SUCCESS) {
|
if (scl_retval == SCL_SUCCESS) {
|
||||||
return tx_param_t.retval;
|
return tx_param_t.retval;
|
||||||
} else {
|
} else {
|
||||||
SCL_LOG(("get rssi error\n"));
|
SCL_LOG(("get rssi error\r\n"));
|
||||||
return SCL_ERROR;
|
return SCL_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue