example: fp-locate-suggest
Not working properly without changes to src/mm.c, concretely all FP transactions only transmitting a single message are currently broken since the transaction is closed before the PP can respond to the page message. Uncomment dect_transaction_close() in dect_mm_info_req() for testing. Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
f3a25140f0
commit
8a59a4cd9d
|
@ -2,6 +2,7 @@ ss
|
|||
mm-pp
|
||||
hijack
|
||||
fp-mm
|
||||
fp-locate-suggest
|
||||
fp-cc
|
||||
fp-clms
|
||||
fp-broadcast-page
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CFLAGS += $(EVENT_CFLAGS)
|
||||
LDFLAGS += -Wl,-rpath $(PWD)/src -Lsrc -ldect $(EVENT_LDFLAGS)
|
||||
PROGRAMS += ss hijack
|
||||
PROGRAMS += fp-mm fp-cc fp-clms fp-broadcast-page
|
||||
PROGRAMS += fp-mm fp-locate-suggest fp-cc fp-clms fp-broadcast-page
|
||||
PROGRAMS += fp-siemens-proprietary
|
||||
PROGRAMS += pp-access-rights pp-access-rights-terminate pp-location-update
|
||||
PROGRAMS += pp-detach pp-info-request pp-cc pp-list-access pp-clms
|
||||
|
@ -21,6 +21,10 @@ fp-mm-destdir := $(destdir)
|
|||
fp-mm-obj += $(fp-common-obj)
|
||||
fp-mm-obj += fp-mm.o
|
||||
|
||||
fp-locate-suggest-destdir := $(destdir)
|
||||
fp-locate-suggest-obj += $(fp-common-obj)
|
||||
fp-locate-suggest-obj += fp-locate-suggest.o
|
||||
|
||||
fp-cc-destdir := $(destdir)
|
||||
fp-cc-obj += $(fp-common-obj)
|
||||
fp-cc-obj += audio.o
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* DECT Mobility Management FP LOCATE-SUGGEST example
|
||||
*
|
||||
* Copyright (c) 2011 Patrick McHardy <kaber@trash.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <dect/libdect.h>
|
||||
#include "common.h"
|
||||
|
||||
static void mm_locate_ind(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
struct dect_mm_locate_param *param)
|
||||
{
|
||||
}
|
||||
|
||||
static void mm_info_req(struct dect_handle *dh,
|
||||
const struct dect_ipui *ipui)
|
||||
{
|
||||
struct dect_ie_info_type info_type;
|
||||
struct dect_mm_info_param req = { .info_type = &info_type };
|
||||
struct dect_mm_endpoint *mme;
|
||||
|
||||
mme = dect_mm_endpoint_alloc(dh, ipui);
|
||||
if (mme == NULL)
|
||||
return;
|
||||
|
||||
info_type.num = 1;
|
||||
info_type.type[0] = DECT_INFO_LOCATE_SUGGEST;
|
||||
dect_mm_info_req(dh, mme, &req);
|
||||
}
|
||||
|
||||
static struct dect_mm_ops mm_ops = {
|
||||
.mm_locate_ind = mm_locate_ind,
|
||||
};
|
||||
|
||||
static struct dect_ops ops = {
|
||||
.mm_ops = &mm_ops,
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
dect_fp_common_options(argc, argv);
|
||||
dect_common_init(&ops, argv[1]);
|
||||
|
||||
mm_info_req(dh, &ipui);
|
||||
dect_event_loop();
|
||||
|
||||
dect_common_cleanup(dh);
|
||||
return 0;
|
||||
}
|
Reference in New Issue