diff options
author | Patrick McHardy <kaber@trash.net> | 2010-09-03 13:20:47 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-09-03 13:20:47 +0200 |
commit | ac6d2ef7ae9ed6bd718a4c141a6c282f096297be (patch) | |
tree | b865137266c53981c5351983353b36b98e65dd90 | |
parent | 20d309fc70c54fc320c338dfb42802ef60f0d03b (diff) |
example: prefix FP examples with fp-
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | example/.gitignore | 7 | ||||
-rw-r--r-- | example/Makefile.in | 29 | ||||
-rw-r--r-- | example/fp-broadcast-page.c (renamed from example/discover.c) | 0 | ||||
-rw-r--r-- | example/fp-clms.c | 47 | ||||
-rw-r--r-- | example/fp-mm.c (renamed from example/mm-fp.c) | 0 | ||||
-rw-r--r-- | example/pp-clms.c (renamed from example/clms.c) | 24 |
6 files changed, 69 insertions, 38 deletions
diff --git a/example/.gitignore b/example/.gitignore index 8576339..201baa6 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1,14 +1,15 @@ cc ss -clms -mm-fp mm-pp -discover hijack +fp-mm +fp-clms +fp-broadcast-page pp-access-rights pp-access-rights-terminate pp-location-update pp-detach pp-info-request pp-list-access +pp-clms pp-wait-page diff --git a/example/Makefile.in b/example/Makefile.in index 86787e0..b431ce6 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -1,8 +1,9 @@ CFLAGS += $(EVENT_CFLAGS) LDFLAGS += -Wl,-rpath $(PWD)/src -Lsrc -ldect $(EVENT_LDFLAGS) -PROGRAMS += cc ss clms mm-fp discover hijack +PROGRAMS += cc ss hijack +PROGRAMS += fp-mm fp-clms fp-broadcast-page PROGRAMS += pp-access-rights pp-access-rights-terminate pp-location-update -PROGRAMS += pp-detach pp-info-request pp-list-access pp-wait-page +PROGRAMS += pp-detach pp-info-request pp-list-access pp-clms pp-wait-page destdir := usr/share/dect/examples @@ -19,13 +20,17 @@ ss-destdir := $(destdir) ss-obj += $(common-obj) ss-obj += ss.o -clms-destdir := $(destdir) -clms-obj += $(common-obj) -clms-obj += clms.o +fp-mm-destdir := $(destdir) +fp-mm-obj += $(common-obj) +fp-mm-obj += fp-mm.o -mm-fp-destdir := $(destdir) -mm-fp-obj += $(common-obj) -mm-fp-obj += mm-fp.o +fp-clms-destdir := $(destdir) +fp-clms-obj += $(common-obj) +fp-clms-obj += fp-clms.o + +fp-broadcast-page-destdir := $(destdir) +fp-broadcast-page-obj += $(common-obj) +fp-broadcast-page-obj += fp-broadcast-page.o pp-access-rights-destdir := $(destdir) pp-access-rights-obj += $(pp-common-obj) @@ -51,14 +56,14 @@ pp-list-access-destdir := $(destdir) pp-list-access-obj += $(pp-common-obj) pp-list-access-obj += pp-list-access.o +pp-clms-destdir := $(destdir) +pp-clms-obj += $(pp-common-obj) +pp-clms-obj += pp-clms.o + pp-wait-page-destdir := $(destdir) pp-wait-page-obj += $(pp-common-obj) pp-wait-page-obj += pp-wait-page.o -discover-destdir:= $(destdir) -discover-obj += $(common-obj) -discover-obj += discover.o - hijack-destdir := $(destdir) hijack-obj += $(common-obj) hijack-obj += hijack.o diff --git a/example/discover.c b/example/fp-broadcast-page.c index 6c5151c..6c5151c 100644 --- a/example/discover.c +++ b/example/fp-broadcast-page.c diff --git a/example/fp-clms.c b/example/fp-clms.c new file mode 100644 index 0000000..f677cf8 --- /dev/null +++ b/example/fp-clms.c @@ -0,0 +1,47 @@ +/* + * DECT FP CLMS example + * + * Copyright (c) 2010 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 <dect/libdect.h> +#include "common.h" + +static const char *name = "- FP 1 -"; + +#define debug(fmt, args...) printf("IWU: " fmt, ## args); + +static void dect_invoke_clms(struct dect_handle *dh) +{ + DECT_DEFINE_MSG_BUF_ONSTACK(_mb), *mb = &_mb; + struct dect_ie_network_parameter network_parameter; + + network_parameter.discriminator = DECT_NETWORK_PARAMETER_DEVICE_NAME; + network_parameter.len = strlen(name); + memcpy(network_parameter.data, name, network_parameter.len); + + debug("build CLMS message\n"); + if (dect_build_sfmt_ie(dh, DECT_IE_NETWORK_PARAMETER, mb, + &network_parameter.common) < 0) + return; + + dect_mncl_unitdata_req(dh, DECT_CLMS_FIXED, NULL, mb); +} + +static struct dect_ops ops; + +int main(int argc, char **argv) +{ + dect_common_init(&ops, argv[1]); + + dect_invoke_clms(dh); + + dect_common_cleanup(dh); + return 0; +} diff --git a/example/mm-fp.c b/example/fp-mm.c index cce8a3f..cce8a3f 100644 --- a/example/mm-fp.c +++ b/example/fp-mm.c diff --git a/example/clms.c b/example/pp-clms.c index 7a59294..da4a1fc 100644 --- a/example/clms.c +++ b/example/pp-clms.c @@ -13,27 +13,8 @@ #include <dect/libdect.h> #include "common.h" -static const char *name = "- FP 1 -"; - #define debug(fmt, args...) printf("IWU: " fmt, ## args); -static void dect_invoke_clms(struct dect_handle *dh) -{ - DECT_DEFINE_MSG_BUF_ONSTACK(_mb), *mb = &_mb; - struct dect_ie_network_parameter network_parameter; - - network_parameter.discriminator = DECT_NETWORK_PARAMETER_DEVICE_NAME; - network_parameter.len = strlen(name); - memcpy(network_parameter.data, name, network_parameter.len); - - debug("build CLMS message\n"); - if (dect_build_sfmt_ie(dh, DECT_IE_NETWORK_PARAMETER, mb, - &network_parameter.common) < 0) - return; - - dect_mncl_unitdata_req(dh, DECT_CLMS_FIXED, NULL, mb); -} - static void dect_mncl_unitdata_ind(struct dect_handle *dh, enum dect_clms_message_types type, struct dect_mncl_unitdata_param *param, @@ -71,10 +52,7 @@ int main(int argc, char **argv) { dect_common_init(&ops, argv[1]); - if (dh->mode == DECT_MODE_FP) - dect_invoke_clms(dh); - else - dect_event_loop(); + dect_event_loop(); dect_common_cleanup(dh); return 0; |