Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Задержка OpenAT
Форум разработчиков электроники ELECTRONIX.ru > Интерфейсы > Форумы по интерфейсам > Сотовая связь и ее приложения
kban
Как организовать длительную (>30 секунд) задержку в OpenAT приложении?
dezzer
Там же таймеры есть, в чём проблема?
sobr
Цитата(kban @ Jun 27 2008, 12:45) *
Как организовать длительную (>30 секунд) задержку в OpenAT приложении?

Подробнее скажи что хочешь сделать...
de__
для меня тоже это тоже актуально.
Пока обхожусь псевдомногозадачностью и мне большие задержки в одном потоке не нужны. По идее это более изящно. Меньше нагрузка на проц и защита от зависания.
По идее (по мануалу) внешня схема должна сбрасывать "сторожевого пса".

Есть ещё вопросы (сразу до кучи) по Q24. Из за того что в этом модеме (в отличии от Q26) нет истинной многозадачности:
1. как организовать задержки без выхода из потока. (без передачи управления). То есть хочу, например, иметь функцию типа bool Delay_ms(unsigned long ms);
2. можно ли как нибудь в одном потоке организовать запросы АТ команд? То есть выполняем первую команду. После того как она выполнилась - выполняем 2ую команду и т.д. С помощью обработчиков то можно. Но хотелось бы как то проще. линейно.
kban
C таймерами заробрался... Но возник другой вопрос
sobr - вы писали про функцию adl_atCmdSend ( "",NULL,NULL,NULL);
А где про неё можно узнать подробнее? И чего она требует? (в adl-евских .h файлах я её не нашёл....)
sobr
Цитата(kban @ Jul 1 2008, 13:17) *
А где про неё можно узнать подробнее? И чего она требует? (в adl-евских .h файлах я её не нашёл....)

не получается прилепить файл... попробую так:

Код
3.3.5.5 The adl_atCmdSend Function
Add command to the required port command stack, in order to be executed as soon
as this port is ready.
• Prototype
s8 adl_atCmdSend ( ascii * atstr,
adl_atRspHandler_t rsphdl,
… )
• Parameters
atstr:
The string (name) of the command we want to send. Since this service only
handles AT commands, this string has to begin by the "AT" characters.
rsphdl:
The response handler of the callback function associated to the command.
…:
A list of strings of the response to subscribed to. This list has to be
terminated by NULL.
• Returned values
o OK on success
o ERROR if an error occurred
o ADL_RET_ERR_SERVICE_LOCKED if called from a low level interrupt handler
Note:
Arguments rsphdl and the list of subscribed responses can be set to NULL to only
send the command
3.3.5.6 The adl_atCmdSendExt Function
This function sends AT command with 2 added arguments compared to
adl_atCmdCreate / adl_atCmdSend : a NI (Notification Identifier) and a Context.
Add command to the required port command stack, in order to be executed as soon
as this port is ready.
• Prototype
s8 adl_atCmdSendExt ( ascii * atstr,
adl_atPort_e port,
u16 NI,
ascii * Contxt,
adl_atRspHandler_t rsphdl,
… )
API
AT Commands Service
© Confidential Page: 65 / 365
This document is the sole and exclusive property of Wavecom. Not to be distributed or divulged without
prior written agreement.
WM_DEV_OAT_UGD_060 - 003 December 17, 2007
• Parameters
atstr:
The string (name) of the command we want to send. Since this service only
handles AT commands, this string has to begin by the "AT" characters.
port:
The required port on which the command will be executed.
NI:
This parameter is to hold the Notification Identifier provided by the
command handler when re sending the command already subscribed to
solve any loop effect.
Note:
In this current release the notification identifier (NI) is not used.
Contxt:
Context made to hold information gathered at the time the command was
sent.
rsphdl:
The response handler of the callback function associated to the command.
…:
A list of strings of the response to subscribed to. This list has to be
terminated by NULL.
• Returned values
o OK on success
o ERROR if an error occurred
o ADL_RET_ERR_SERVICE_LOCKED if called from a low level interrupt handler
Note:
Arguments rsphdl and the list of subscribed responses can be set to NULL to only
send the command.
3.3.5.7 The adl_atCmdSendText Function
Sends text for a running text command.
• Prototype
s8 adl_atCmdSendText ( adl_port_e Port,
ascii * Text )
• Parameters
Port:
Port on which is currently running the "Text Mode" command, waiting for
some text input.
API
AT Commands Service
© Confidential Page: 66 / 365
This document is the sole and exclusive property of Wavecom. Not to be distributed or divulged without
prior written agreement.
WM_DEV_OAT_UGD_060 - 003 December 17, 2007
Text:
Text to be provided to the running "Text Mode" command on the required
port. If the text does not end with a ‘Ctrl-Z’ character (0x1A code), the
function will add it automatically.
• Returned values
o OK on success
o ERROR if an error occurred
o ADL_RET_ERR_SERVICE_LOCKED if called from a low level Interrupt handler.
• Example
This example demonstrates how to use the AT Command Sending service in a
nominal case (error cases not handled) with a Wireless CPU®.
Complete examples using the AT Command service are also available on the SDK.
• Example 1
// ati responses callback function
s16 ATI_Response_Handler(adl_atResponse_t *paras)
{
TRACE((1, "Reponse handled"));
TRACE((1, paras->StrData));
return FALSE;
}
// function 1
void function1(adl_InitType_e adlInitType)
{
// We send ati and subscribe to its responses
adl_atCmdSend("ati",
(adl_atRspHandler_t)ATI_Response_Handler,
"*",
NULL);
}
API
AT Commands Service
© Confidential Page: 67 / 365
This document is the sole and exclusive property of Wavecom. Not to be distributed or divulged without
prior written agreement.
WM_DEV_OAT_UGD_060 - 003 December 17, 2007
• Example 2
// at+mycmd responses callback function 2
s16 AT_MYCMD_Response_Handler_2(adl_atResponse_t *paras)
{
// we send a terminal response
adl_atSendStdResponsePort(ADL_AT_RPS, paras-> Port, ADL_STR_OK);
return FALSE;
}
// at+mycmd callback function 1
void AT_MYCMD_Handler_l(adl_atCmdPrepaerser_t *paras)
{
// we send a terminal response
adl_atSendStdResponsePort(ADL_AT_RSP, paras->Port, ADL_STR_OK);
}
// at+mycmd callback function 2
void AT_MYCMD_Handler_2(adl_atCmdPreParser_t *paras)
}
// Only spying we resend the command
adl_atCmdSendExt(paras->StrData,
paras->Port,
0,
NULL,
(adl_atRspHandler_t)AT_MYCMD_Response_Handler_2
“*”,
NULL);
}
// function 1
void function1(adl_InitType_e adl InitType)
{
// Subscribe to the ‘at+mycmd’ command.
adl_atCmdSubscribe (“attmycmd”,
(adl_atCmdHandler_t)AT_MYCMD_Handler_1
ADL_CMD_TYPE_ACT);
// Subscribe to the ‘at+mycmd’ command again
adl_atCmdSubscribe (“at+mycmd”,
(adl_atCmdHandler_t)AT_MYCMD_Handler_2,
ADL_CMD_TYPE_ACT
}
sobr
Жди, у меня почта не уходит...
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2025 Invision Power Services, Inc.