jplaschke
Joined: 04 Mar 2009 Posts: 23
|
Posted: Fri Mar 20, 2009 4:02 pm Post subject: Spider help |
|
|
I took the locate example and changed the menus such that locate was a sub menu
Sometimes, it seems to get lost as far as what menu it is in.
I do a query location (from a sub-menu) and the information is returned.
The following is done in the Answer. The query is called from a submenu.
I think the display_text and display_text_raw provide a "OK" "BACK" and this confuses spider
Also, the display sometimes does not go to the current menu. It is only shown when "Back" or "OK" from menu where query was done.
I followed the example but am not sure about the return from a callback.
called in answer query
====================================
r = sprintc (r, '\0');
display_text (buf, NULL);
//Q_DISPLAY_TEXT_HIGH_PRIORITY | Q_DISPLAY_TEXT_USER_CLEAR);
free (buf);
======================================
SNodeP cb_n = { lc_Demo, NULL };
SNodeP cb_GetInfo_n = { lc_GetInfo, cb_GetInfo };
SNodeP cb_StoreInfo_n = { lc_StoreInfo, cb_StoreInfo };
/* *INDENT-OFF* */
SEdgeP cb_edges_p[] = {
{&cb_n, &cb_GetInfo_n},
{&cb_n, &cb_ReadEfLoci_n},
NULL
};
u8 cb_GetInfo (SCtx * ctx, u8 action)
{
u8 *tmp, *res, *ms2;
u8 *ms;
u8 *q;
u8 l, j, i;
u8 alpha[ALPHA_LEN];
if (action == APP_ENTER)
{
tmp = NULL;
ms = NULL;
//u8 *pAlpha = NULL;
res =
get_input (locale (lc_Service_Nr), 7, MAX_NR_LEN - 1, NULL,
Q_GET_INPUT_DIGITS);
if (res == ENULL)
return APP_END; // APP_END;
if (res == NULL)
return APP_BACK; // APP_BACK;
//res[res[1] + 1] = '\0';
if (res != ENULL && res != NULL)
{
ms = str2msisdn(&res[2],MSISDN_ADN, MEM_R);
tmp = malloc (20);
q = create_head_q (tmp, t_Position_mime, ms, MSISDN_ADN);
send_sms (tmp, q - tmp, ms, MSISDN_ADN,0x16, 0x7F, alphastr,
NULL);
}
free (tmp);
free (ms);
//spider_back(ctx);
return APP_BACK;
}
return action;
}
u8 cb_StoreInfo (SCtx * ctx, u8 action)
{
u8 *buf = malloc (200);
u8 *r = buf;
u8 i, rtn;
u8 file_buf[18];
if (action == APP_ENTER)
{
// details removed
rtn = display_text (buf, NULL);
rtn = APP_BACK;
if (rtn != APP_END)
return APP_BACK;
return rtn;
}
return action;
} |
|