[101] | 1 | /*
|
---|
| 2 | * TOPPERS ECHONET Lite Communication Middleware
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2015 Cores Co., Ltd. Japan
|
---|
| 5 | *
|
---|
| 6 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
| 7 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
| 8 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
| 9 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
| 10 | * \¦C±Ìpð¨æÑºLÌ³ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
| 11 | * XR[hÉÜÜêĢ鱯D
|
---|
| 12 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
| 13 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
| 14 | gip
|
---|
| 15 | * Ò}j
|
---|
| 16 | AÈÇjÉCãLÌì \¦C±Ìpð¨æÑºL
|
---|
| 17 | * Ì³ÛØKèðfÚ·é±ÆD
|
---|
| 18 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
| 19 | * pūȢ`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
| 20 | * ÆD
|
---|
| 21 | * (a) Äzzɺ¤hL
|
---|
| 22 | gipÒ}j
|
---|
| 23 | AÈÇjÉCãLÌ
|
---|
| 24 | * ì \¦C±Ìpð¨æÑºLÌ³ÛØKèðfÚ·é±ÆD
|
---|
| 25 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
| 26 | * ñ·é±ÆD
|
---|
| 27 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
| 28 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
| 29 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
| 30 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
| 31 | * ÆÓ·é±ÆD
|
---|
| 32 | *
|
---|
| 33 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
| 34 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
| 35 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
| 36 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
| 37 | * ÌÓCðíÈ¢D
|
---|
| 38 | *
|
---|
| 39 | * @(#) $Id: wamp_broker.h 101 2015-06-02 15:37:23Z coas-nagasima $
|
---|
| 40 | */
|
---|
| 41 |
|
---|
| 42 | #ifndef WAMP_BROKER_H
|
---|
| 43 | #define WAMP_BROKER_H
|
---|
| 44 |
|
---|
| 45 | typedef struct wamp_subscription
|
---|
| 46 | {
|
---|
| 47 | struct wamp_state *s;
|
---|
| 48 | unsigned int requestId;
|
---|
| 49 | int subscriptionId;
|
---|
| 50 | char deviceName[40];
|
---|
| 51 | char *proprtyName;
|
---|
| 52 | uint16_t devType;
|
---|
| 53 | uint8_t epc;
|
---|
| 54 | } wamp_subscription_t;
|
---|
| 55 |
|
---|
| 56 | typedef struct wamp_broker
|
---|
| 57 | {
|
---|
| 58 | struct wamp_state *s;
|
---|
| 59 | unsigned int requestId;
|
---|
| 60 | int subscriptionId;
|
---|
| 61 | wamp_subscription_t subscriptions[10];
|
---|
| 62 | wamp_subscription_t *current_subscription;
|
---|
| 63 | const char *error;
|
---|
| 64 | } wamp_broker_t;
|
---|
| 65 |
|
---|
| 66 | void wamp_broker_subscribe(wamp_broker_t *broker);
|
---|
| 67 | void wamp_broker_subscribe_request_id(wamp_broker_t *broker, const char *value);
|
---|
| 68 | void wamp_broker_subscribe_options_param(wamp_broker_t *broker, jsonsl_action_t action,
|
---|
| 69 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 70 | void wamp_broker_subscribe_options(wamp_broker_t *broker);
|
---|
| 71 | void wamp_broker_subscribe_topic(wamp_broker_t *broker, const char *value);
|
---|
| 72 | void wamp_broker_subscribe_close(struct wamp_state *s);
|
---|
| 73 |
|
---|
| 74 | void wamp_broker_unsubscribe(wamp_broker_t *broker);
|
---|
| 75 | void wamp_broker_unsubscribe_request_id(wamp_broker_t *broker, const char *value);
|
---|
| 76 | void wamp_broker_unsubscribe_subscription_id(wamp_broker_t *broker, const char *value);
|
---|
| 77 | void wamp_broker_unsubscribe_close(struct wamp_state *s);
|
---|
| 78 |
|
---|
| 79 | void wamp_broker_publish(wamp_broker_t *broker);
|
---|
| 80 | void wamp_broker_publish_request_id(wamp_broker_t *s, const char *value);
|
---|
| 81 | void wamp_broker_publish_options(wamp_broker_t *s, const char *value);
|
---|
| 82 | void wamp_broker_publish_options_param(wamp_broker_t *s, jsonsl_action_t action,
|
---|
| 83 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 84 | void wamp_broker_publish_topic(wamp_broker_t *s, const char *value);
|
---|
| 85 | void wamp_broker_publish_arguments(wamp_broker_t *s, const char *value);
|
---|
| 86 | void wamp_broker_publish_arguments_param(wamp_broker_t *s, jsonsl_action_t action,
|
---|
| 87 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 88 | void wamp_broker_publish_argumentskw(wamp_broker_t *s, const char *value);
|
---|
| 89 | void wamp_broker_publish_argumentskw_param(wamp_broker_t *s, jsonsl_action_t action,
|
---|
| 90 | struct jsonsl_state_st *state, const char *buf);
|
---|
| 91 | void wamp_broker_publish_close(struct wamp_state *s);
|
---|
| 92 |
|
---|
| 93 | void wamp_broker_publish_inf(wamp_broker_t *broker, uint16_t pubId, int deviceId,
|
---|
| 94 | uint16_t devType, uint8_t epc, uint8_t pdc, uint8_t *p_edt);
|
---|
| 95 |
|
---|
| 96 | #endif // WAMP_BROKER_H
|
---|