sms support possible?

Erin Yueh erin_yueh at openmoko.com
Mon Aug 20 04:44:15 CEST 2007


pHilipp Zabel wrote:
> On 8/18/07, Krzysztof Kajkowski <cayco at poczta.cayco.pl> wrote:
>   
>> 2007/8/15, M. Dietrich <mdt at emdete.de>:
>>     
>>> On Sun, Aug 12, 2007 at 03:05:40AM +0200, pHilipp Zabel wrote:
>>>       
>>>> The attached patch adds libgsmd/sms.h and pin.h to the list of
>>>> installed headers. But I'm not sure if the implementation is ready
>>>> for those two?
>>>>
>>>>         
>>> now the compile of my app fails because a common/linux_list.h is
>>> missing... should it be installed also?
>>>
>>>       
>> Hi! I also got this error (fresh OM install). How to fix it?
>>     
>
> I'm sorry, I can't reproduce this. My fresh openmoko-image build from
> org.openembedded.dev works just fine, I can even build old
> openmoko-libs
> against libgsmd and the attached test program compiles, too.
>
> regards
> Philipp
>   
> ------------------------------------------------------------------------
>
> #include <libgsmd/libgsmd.h>
> #include <stdio.h>
> #include <strings.h>
>
> /* message handler example */
> int pin_msg_handler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
> {
> 	struct gsmd_pin *pin;
>
> 	if (gmh->msg_type != GSMD_MSG_PIN)
> 		printf("error, not a pin message\n");
> 	if (gmh->msg_subtype != GSMD_PIN_INPUT)
> 		printf("error, unknown pin message subtype\n");
>
> 	pin = (struct gsmd_pin *)gmh->data;
>
> 	if (pin->type == GSMD_PIN_SIM_PIN)
> 		printf("SIM PIN message\n");
> 	else
> 		printf("PIN type %d message\n", pin->type);
>
> 	strcpy(pin->pin, "1234");
>
> 	return 0;
> }
>
> /* event handler examples */
> int netreg_evt_handler(struct lgsm_handle *lh, int evt_type, struct gsmd_evt_auxdata *aux)
> {
> 	if (evt_type != GSMD_EVT_NETREG)
> 		printf("error, not a netreg event\n");
>
> 	printf("state %d, lac %d, ci %d\n", aux->u.netreg.state, aux->u.netreg.lac, aux->u.netreg.ci);
> }
>
> int pin_evt_handler(struct lgsm_handle *lh, int evt_type, struct gsmd_evt_auxdata *aux)
> {
> 	if (evt_type != GSMD_EVT_PIN)
> 		printf("error, not a pin event\n");
>
> 	if (aux->u.pin.type == GSMD_PIN_SIM_PIN)
> 		printf("SIM PIN request\n");
> 	else
> 		printf("PIN type %d request\n", aux->u.pin.type);
> }
>
> /* main function */
> int main (int argc, char *argv[])
> {
> 	struct lgsm_handle *lh;
> 	int ret;
>
> 	printf("initialize libgsmd\n");
> 	lh = lgsm_init(LGSMD_DEVICE_GSMD);
>
> 	printf("register message handler\n");
> 	ret = lgsm_register_handler(lh, GSMD_MSG_PIN, pin_msg_handler);
>
> 	printf("register event handlers\n");
> 	ret = lgsm_evt_handler_register(lh, GSMD_EVT_NETREG, netreg_evt_handler);
> 	ret = lgsm_evt_handler_register(lh, GSMD_EVT_PIN, pin_evt_handler);
>
> 	printf("power on phone\n");
> 	ret = lgsm_phone_power(lh, 1);
>
> 	lgsm_netreg_register(lh, /*oper*/0);
>
> 	printf("power off phone\n");
> 	ret = lgsm_phone_power(lh, 0);
>
> 	printf("unregister event handlers\n");
> 	lgsm_evt_handler_unregister(lh, GSMD_EVT_NETREG);
> 	lgsm_evt_handler_unregister(lh, GSMD_EVT_PIN);
>
> 	printf("unregister pin message handler\n");
> 	lgsm_unregister_handler(lh, GSMD_MSG_PIN);
>
> 	printf("terminate libgsmd\n");
> 	ret = lgsm_exit(lh);
> 	if (ret < 0) {
> 		printf("error %d\n", errno);
> 	}
> }
>   
umm....i didn't meet this problem either. Here are the steps i did: only
build gsmd

LOCAL machine:
svn co http://svn.openmoko.org/trunk/src/target/gsm/
autoreconf --install --force
./autogen.sh
CC=arm-linux-gcc CFLAGS="-march=armv4t -mtune=arm920t" ./configure
--prefix=/usr --host=arm-linux --target=arm-linux
./PACK_TARGET.sh
scp bin-gsm.tar.bz2 root at 192.168.0.202:/

TARGET:
ssh root at 192.168.0.202
cd /
tar -xjf bin-gsm.tar.bz2

PS. 'PACK_TARGET.sh' this script will run 'make install' and tar all
needed lib files to a bz2 file. Unzip it in the target, then you can use
the new gsmd. The script is from Sean, and it can save some works.

Cheers,
Erin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PACK_TARGET.sh
Type: application/x-shellscript
Size: 673 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/gsmd-devel/attachments/20070820/fd58de35/PACK_TARGET.bin


More information about the gsmd-devel mailing list