iot packages test ok!
This commit is contained in:
parent
960413976c
commit
0be053d4ac
|
@ -43,6 +43,7 @@ static int bc26_power_on(struct at_device *device)
|
|||
RT_ASSERT(device);
|
||||
|
||||
bc26 = (struct at_device_bc26 *)device->user_data;
|
||||
bc26->power_status = RT_TRUE;
|
||||
|
||||
/* not nead to set pin configuration for bc26 device power on */
|
||||
if (bc26->power_pin == -1)
|
||||
|
@ -51,9 +52,7 @@ static int bc26_power_on(struct at_device *device)
|
|||
}
|
||||
|
||||
rt_pin_write(bc26->power_pin, PIN_HIGH);
|
||||
|
||||
rt_thread_mdelay(500);
|
||||
|
||||
rt_pin_write(bc26->power_pin, PIN_LOW);
|
||||
|
||||
return(RT_EOK);
|
||||
|
@ -62,6 +61,7 @@ static int bc26_power_on(struct at_device *device)
|
|||
static int bc26_power_off(struct at_device *device)
|
||||
{
|
||||
at_response_t resp = RT_NULL;
|
||||
struct at_device_bc26 *bc26 = RT_NULL;
|
||||
|
||||
RT_ASSERT(device);
|
||||
|
||||
|
@ -80,8 +80,11 @@ static int bc26_power_off(struct at_device *device)
|
|||
}
|
||||
|
||||
at_delete_resp(resp);
|
||||
return(RT_EOK);
|
||||
|
||||
bc26 = (struct at_device_bc26 *)device->user_data;
|
||||
bc26->power_status = RT_FALSE;
|
||||
|
||||
return(RT_EOK);
|
||||
}
|
||||
|
||||
static int bc26_sleep(struct at_device *device)
|
||||
|
@ -92,6 +95,10 @@ static int bc26_sleep(struct at_device *device)
|
|||
RT_ASSERT(device);
|
||||
|
||||
bc26 = (struct at_device_bc26 *)device->user_data;
|
||||
if ( ! bc26->power_status)//power off
|
||||
{
|
||||
return(RT_EOK);
|
||||
}
|
||||
if (bc26->sleep_status)//is sleep status
|
||||
{
|
||||
return(RT_EOK);
|
||||
|
@ -132,6 +139,11 @@ static int bc26_wakeup(struct at_device *device)
|
|||
RT_ASSERT(device);
|
||||
|
||||
bc26 = (struct at_device_bc26 *)device->user_data;
|
||||
if ( ! bc26->power_status)//power off
|
||||
{
|
||||
LOG_E("the power is off and the wake-up cannot be performed");
|
||||
return(-RT_ERROR);
|
||||
}
|
||||
if ( ! bc26->sleep_status)//no sleep status
|
||||
{
|
||||
return(RT_EOK);
|
||||
|
@ -858,6 +870,7 @@ static int bc26_init(struct at_device *device)
|
|||
{
|
||||
struct at_device_bc26 *bc26 = (struct at_device_bc26 *) device->user_data;
|
||||
|
||||
bc26->power_status = RT_FALSE;//default power is off.
|
||||
bc26->sleep_status = RT_FALSE;//default sleep is disabled.
|
||||
|
||||
/* initialize AT client */
|
||||
|
|
|
@ -49,6 +49,7 @@ struct at_device_bc26
|
|||
void *socket_data;
|
||||
void *user_data;
|
||||
|
||||
rt_bool_t power_status;
|
||||
rt_bool_t sleep_status;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue