Page
25
72. Double click on
main.c
to open this file in the editor pane on the right.
73. Scroll down until you reach a line starting with
char deviceId[]
then assign a device identifier of
your choice by replacing the text within the quote marks.
74. Next we need to add Flow Endpoint address info to enable the device to connect to Flow:
From the cloned version of the Flow project you edited earlier, copy the
Base URL
endpoint info,
either from the notepad copy you made, or by again getting this from the
Endpoints
section at the
bottom of the Flow GUI.
F
IGURE
29
-
A
CCESSING
F
LOW
E
NDPOINT
I
NFORMATION
75. Back in the Keil IDE, scroll a few lines up from the device ID in main.c to a line which contains
#include "FlowStreamClient.h”
x
76. Right-
click on the line and select Open document “
FlowStreamClient.h
”. This will open the
FlowStreamClient.h header file in a new tab
F
IGURE
30
-
O
PENING THE
F
LOW
S
TREAM
C
LIENT
.
H
H
EADER
F
ILE
77. Edit the
DEFAULT_FLOW_HOST
,
FLOW_BASE_URL
and
FLOW_ENDPOINT
defines to match
your endpoint information from your Flow application (replace only
the text between quotes “ ”).
For this example your FLOW_ENDPOINT should not need to be changed, the default “/pubnub”
should be used.