modem: hl7800: reset API should be async

All other APIs that need to reset the modem do so in an async way.
Make the rest API async as well.
This fixes issues where modem events related to the reset
were not generated properly.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
Ryan Erickson 2024-01-16 09:29:41 -06:00 committed by Benjamin Cabé
parent 1674114fd2
commit de83072776
2 changed files with 7 additions and 11 deletions

View file

@ -5621,20 +5621,16 @@ static void mdm_reset_work_callback(struct k_work *item)
{
ARG_UNUSED(item);
mdm_hl7800_reset();
hl7800_lock();
(void)modem_reset_and_configure();
hl7800_unlock();
}
int32_t mdm_hl7800_reset(void)
{
int ret;
hl7800_lock();
ret = modem_reset_and_configure();
hl7800_unlock();
return ret;
return k_work_reschedule_for_queue(&hl7800_workq, &iface_ctx.mdm_reset_work, K_NO_WAIT);
}
static void mdm_power_off_work_callback(struct k_work *item)

View file

@ -265,7 +265,7 @@ int32_t mdm_hl7800_power_off(void);
/**
* @brief Reset the HL7800 (and allow it to reconfigure).
*
* @return int32_t 0 for success
* @return int32_t >= 0 for success, < 0 for failure
*/
int32_t mdm_hl7800_reset(void);