Fixed spelling 55/14355/1
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Fri, 1 Jun 2018 13:00:15 +0000 (15:00 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 13 Jun 2018 15:15:28 +0000 (17:15 +0200)
Change-Id: Id7c183face3179a3b9cec7ed128e3a2561d9f3ad
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
README.md
memo-supervisor.txt
src/afb-supervision.c
src/afb-ws-client.c
src/afb-ws-client.h
src/afb-xreq.h
src/afs-config.c
src/afs-main.c
src/afs-supervision.h
src/afs-supervisor.c

index 8445700..e548bbb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 ### Application Framework Binder
-This is an undergoing work, publication is only intended for developers to review and provide feedback. 
+This is an undergoing work, publication is only intended for developers to review and provide feedback.
 
 ### License
 Apache 2
@@ -35,8 +35,8 @@ $ apt-get install libmagic-dev libjson-c-dev uuid-dev libsystemd-dev libssl-dev
 or under Fedora (excepting libmicrohttpd and rtl-sdr):
 ```
 $ dnf install git passwd iproute openssh-server openssh-client openssh-server # Tools needed on top of Docker Minimal Fedora
-$ dnf install file-devel gcc gdb make pkgconfig cmake  # install gcc developement tool chain + cmake
-$ dnf install file-devel json-c-devel libuuid-devel systemd-devel openssl-devel 
+$ dnf install file-devel gcc gdb make pkgconfig cmake  # install gcc development tool chain + cmake
+$ dnf install file-devel json-c-devel libuuid-devel systemd-devel openssl-devel
 $ dnf install alsa-lib-devel pulseaudio-libs-devel glib2-devel gupnp-av-devel # optional but require to build audio plugin
 ```
 
@@ -55,9 +55,9 @@ $ AFB_DAEMON_DIR=$HOME/app-framework-binder
 $ git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder ${AFB_DAEMON_DIR}
 $ cd ${AFB_DAEMON_DIR}
 $ mkdir -p build; cd build<br />
-$ export PKG_CONFIG_PATH=${LIBMICRODEST}/lib/pkgconfig 
+$ export PKG_CONFIG_PATH=${LIBMICRODEST}/lib/pkgconfig
 $ cmake ..<br />
-$ make; 
+$ make;
 $ sudo make install<br />
 ```
 
@@ -73,12 +73,12 @@ git archive --format=tar.gz --prefix=agl-${PKG_NAME}-${VERSION}/ ${GIT_TAG} -o a
 ### Testing/Debug
 ```
 $ ${AFB_DAEMON_DIR}/build/src/afb-daemon --help
-$ ${AFB_DAEMON_DIR}/build/src/afb-daemon --port=1234 --token='' --ldpaths=${AFB_DAEMON_DIR}/build --sessiondir=/tmp --rootdir=${AFB_DAEMON_DIR}/test 
+$ ${AFB_DAEMON_DIR}/build/src/afb-daemon --port=1234 --token='' --ldpaths=${AFB_DAEMON_DIR}/build --sessiondir=/tmp --rootdir=${AFB_DAEMON_DIR}/test
 ```
 
 ### Starting
 ```
-$ afb-daemon --help 
+$ afb-daemon --help
 $ afb-daemon --verbose --port=<port> --token='' --sessiondir=<working directory> --rootdir=<web directory (index.html)>
 ```
 
@@ -93,12 +93,12 @@ Default behaviour is to locate ROOTDIR in $HOME/.AFB
 ### REST API
 
 Developers are intended to provide a structure containing : API name, corresponding methods/callbacks, and optionally a context and a handle.
-A handle is a void* structure automatically passed to API callbacks. 
-Callbacks also receive HTTP GET data as well as HTTP POST data, in case a POST method was used. 
+A handle is a void* structure automatically passed to API callbacks.
+Callbacks also receive HTTP GET data as well as HTTP POST data, in case a POST method was used.
 Every method should return a JSON object or NULL in case of error.
 
 API plugins can be protected from timeout and other errors. By default this behaviour is deactivated, use --apitimeout to activate it.
-        
+
         STATIC AFB_restapi myApis[]= {
           {"ping"    , AFB_SESSION_NONE,  (AFB_apiCB)ping,     "Ping Function"},
           {"action1" , AFB_SESSION_CHECK, (AFB_apiCB)action1 , "Action-1"},
@@ -110,26 +110,26 @@ API plugins can be protected from timeout and other errors. By default this beha
             AFB_plugin *plugin = malloc (sizeof (AFB_plugin));
             plugin->type  = AFB_PLUGIN_JSON;
             plugin->info  = "Plugin Sample";
-            plugin->prefix= "myPlugin";        
+            plugin->prefix= "myPlugin";
             plugin->apis  = myApis;
             return (plugin);
         }
 
 ### HTML5 and AngularJS Redirects
 
-Binder supports HTML5 redirect mode even with an application baseurl. 
-Default value for application base URL is /opa. 
+Binder supports HTML5 redirect mode even with an application baseurl.
+Default value for application base URL is /opa.
 See Application Framework HTML5 Client template at https://github.com/iotbzh/afb-client-sample
 
-If the Binder receives something like _http://myopa/sample_ when sample is not the homepage of the AngularJS OPA, 
-it will redirect to _http://myopa/#!sample_. 
+If the Binder receives something like _http://myopa/sample_ when sample is not the homepage of the AngularJS OPA,
+it will redirect to _http://myopa/#!sample_.
 This redirect will return the _index.html_ OPA file and will notify AngularJS not to display the homepage, but the sample page.
 
-Warning: in order for AngularJS applications to be able to work with both BASEURL="/" and BASEURL="/MyApp/", all page references have to be relative. 
+Warning: in order for AngularJS applications to be able to work with both BASEURL="/" and BASEURL="/MyApp/", all page references have to be relative.
 
 Recommended model is to develop with a BASEURL="/opa" as any application working with a BASEURL will work without, while the opposite is not true.
 
-Note: If a resource is not accessible from ROOTDIR then the "--alias" switch should be used, as in: --alias=/icons:/usr/share/icons. 
+Note: If a resource is not accessible from ROOTDIR then the "--alias" switch should be used, as in: --alias=/icons:/usr/share/icons.
 Only use alias for external support static files. This should not be used for API and OPA.
 
 
index 13e9d1d..ae1147a 100644 (file)
@@ -2,7 +2,7 @@
 Run the supervisor on the target for the public IP:
 ---------------------------------------------------
 
-       # afs-supervisor --port 1619 --token HELLO 
+       # afs-supervisor --port 1619 --token HELLO
 
 Run the client
 --------------
@@ -49,20 +49,20 @@ verbs that can be run, all are of the API 'supervisor':
 
                execute the API/VERB(ARGS) for the daemon of pid X
 
-               usefull for (s/g)etting monitor info. ex: monitor/get({"apis":true})
+               useful for (s/g)etting monitor info. ex: monitor/get({"apis":true})
 
                bound to the current client session (to be checked: usurpation of session?)
 
        - trace         {"pid":X, ...}
 
-               like monitor/trace but not bound to session (in the future monitor/trace 
+               like monitor/trace but not bound to session (in the future monitor/trace
                will be bound to sessions)
 
                allows to trace specific session or any session
 
                the pid isn't returned in the event (not sure to want it but open...)
 
-               use "name" and "tag" feature of "trace" to discrimate events on the client side.
+               use "name" and "tag" feature of "trace" to discriminate events on the client side.
 
 Examples of dialog:
 -------------------
index fa678ee..f1024c3 100644 (file)
@@ -162,7 +162,7 @@ static void try_connect_supervisor()
                goto end;
        }
 
-       /* negociation */
+       /* negotiation */
        do { srd = read(fd, &initiator, sizeof initiator); } while(srd < 0 && errno == EINTR);
        if (srd < 0) {
                NOTICE("Can't read supervisor %s: %m", supervisor_socket_path);
@@ -232,7 +232,7 @@ static void on_sighup(int signum)
 }
 
 /**
- * initalize the supervision
+ * initialize the supervision
  */
 int afb_supervision_init()
 {
index d694e27..a0c37f3 100644 (file)
@@ -501,10 +501,10 @@ static int get_socket(const char *uri)
 }
 /*
  * Establish a websocket-like client connection to the API of 'uri' and if successful
- * instanciate a client afb_proto_ws websocket for this API using 'itf' and 'closure'.
+ * instantiate a client afb_proto_ws websocket for this API using 'itf' and 'closure'.
  * (see afb_proto_ws_create_client).
  * The systemd event loop 'eloop' is used to handle the websocket.
- * Returns NULL in case of failure with errno set appriately.
+ * Returns NULL in case of failure with errno set appropriately.
  */
 struct afb_proto_ws *afb_ws_client_connect_api(struct sd_event *eloop, const char *uri, struct afb_proto_ws_client_itf *itf, void *closure)
 {
index 574eb9b..620dc50 100644 (file)
@@ -25,19 +25,19 @@ struct sd_event;
 
 /*
  * Makes the WebSocket handshake at the 'uri' and if successful
- * instanciate a wsj1 websocket for this connection using 'itf' and 'closure'.
+ * instantiate a wsj1 websocket for this connection using 'itf' and 'closure'.
  * (see afb_wsj1_create).
  * The systemd event loop 'eloop' is used to handle the websocket.
- * Returns NULL in case of failure with errno set appriately.
+ * Returns NULL in case of failure with errno set appropriately.
  */
 extern struct afb_wsj1 *afb_ws_client_connect_wsj1(struct sd_event *eloop, const char *uri, struct afb_wsj1_itf *itf, void *closure);
 
 /*
  * Establish a websocket-like client connection to the API of 'uri' and if successful
- * instanciate a client afb_proto_ws websocket for this API using 'itf' and 'closure'.
+ * instantiate a client afb_proto_ws websocket for this API using 'itf' and 'closure'.
  * (see afb_proto_ws_create_client).
  * The systemd event loop 'eloop' is used to handle the websocket.
- * Returns NULL in case of failure with errno set appriately.
+ * Returns NULL in case of failure with errno set appropriately.
  */
 extern struct afb_proto_ws *afb_ws_client_connect_api(struct sd_event *eloop, const char *uri, struct afb_proto_ws_client_itf *itf, void *closure);
 
index e2b09db..ae1419f 100644 (file)
@@ -60,7 +60,7 @@ struct afb_xreq
        struct afb_context context;     /**< context of the request */
        struct afb_apiset *apiset;      /**< apiset of the xreq */
        struct json_object *json;       /**< the json object (or NULL) */
-       const struct afb_xreq_query_itf *queryitf; /**< interface of xreq implmentation functions */
+       const struct afb_xreq_query_itf *queryitf; /**< interface of xreq implementation functions */
        int refcount;                   /**< current ref count */
        int replied;                    /**< is replied? */
        int hookflags;                  /**< flags for hooking */
@@ -72,7 +72,7 @@ struct afb_xreq
 
 /**
  * Macro for retrieve the pointer of a structure of 'type' having a field named 'field'
- * of adress 'ptr'.
+ * of address 'ptr'.
  * @param type the type that has the 'field' (ex: "struct mystruct")
  * @param field the name of the field within the structure 'type'
  * @param ptr the pointer to an element 'field'
@@ -82,7 +82,7 @@ struct afb_xreq
 
 /**
  * Macro for retrieve the pointer of a structure of 'type' having a field named "xreq"
- * of adress 'x'.
+ * of address 'x'.
  * @param type the type that has the field "xreq" (ex: "struct mystruct")
  * @param x the pointer to the field "xreq"
  * @return the pointer to the structure that contains the field "xreq" of address 'x'
index 71d5ab7..78fee7d 100644 (file)
@@ -114,7 +114,7 @@ static AFB_options cliOptions[] = {
 
        {SET_AUTH_TOKEN,    1, "token",       "Initial Secret [default=" AFS_SUPERVISOR_TOKEN ", use --token="" to allow any token]"},
 
-       {WS_SERVICE,        1, "ws-server",   "Povide supervisor as websocket"},
+       {WS_SERVICE,        1, "ws-server",   "Provide supervisor as websocket"},
        {DISPLAY_VERSION,   0, "version",     "Display version and copyright"},
        {DISPLAY_HELP,      0, "help",        "Display this help"},
 
index 93e4932..88e4757 100644 (file)
@@ -187,7 +187,7 @@ error:
 }
 
 /**
- * initalize the supervision
+ * initialize the supervision
  */
 int main(int ac, char **av)
 {
index bee40a1..2c76f24 100644 (file)
@@ -37,7 +37,7 @@
 
 
 /**
- * packet initialy sent by monitor at start
+ * packet initially sent by monitor at start
  */
 struct afs_supervision_initiator
 {
index 62adf9b..285d82c 100644 (file)
@@ -401,7 +401,7 @@ static void f_debug_break(struct afb_req req)
 /*************************************************************************************/
 
 /**
- * initalize the supervisor
+ * initialize the supervisor
  */
 static int init_supervisor()
 {