xbee_atcmd: add atcmd callback on response
[protos/xbee.git] / main.h
diff --git a/main.h b/main.h
index ec682f4..693a5c8 100644 (file)
--- a/main.h
+++ b/main.h
@@ -38,6 +38,8 @@ struct xbee_ctx {
        int have_more_command;
        int foreground;
        int channel;
+       int (*func)(void *frame, unsigned len, void *arg);
+       void *arg;
        struct event timeout;
        struct xbee_atcmd *atcmd_query;
 };
@@ -57,8 +59,10 @@ void xbeeapp_log(int always_on_stdout, const char *fmt, ...);
 
 void xbee_rx(struct xbee_dev *dev, int channel, int type,
             void *frame, unsigned len, void *opaque);
-int xbeeapp_send_atcmd(const char *atcmd_str, void *param, unsigned param_len,
-                      int foreground);
+int xbeeapp_send_atcmd(const char *atcmd_str,
+                      void *param, unsigned param_len, int foreground,
+                      int (*func)(void *frame, unsigned len, void *arg),
+                      void *arg);
 int xbeeapp_send_msg(uint64_t addr, void *data, unsigned data_len,
                     int foreground);
 int xbeeapp_dump_config(const char *filename);