example: prefix FP examples with fp-
Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
20d309fc70
commit
ac6d2ef7ae
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
Reference in New Issue