Description
begin()
– resets the internal state machine of the CANIP_Provider and the value of hasInternetDemand(). Invoking begin() stops and resets any established client connections on both ends, to the internet server/client and to the CANIP_Client device. This function needs to be called before run() function calls start maintaining the CANIP service.
Syntax
myIP_provider.begin();
Parameters
none
Returns
nothing (void)
Example Codes:
The following code example is absolute minimal and does not cover errors, connection losses and retries etc. It is for demonstration of the function usage only. See the canip-provider examples in the Arduino IDE for more sophisticated ones.
#include <WiFiNINA.h>
#include "CANIP.h"
WiFiHTTPClient client;
CANIP_Provider myIP_provider(&MCAN0, &BOOTLOADER_SETTING, &client);
#define SECRET_SSID "mySSID"
#define SECRET_PASS "myWiFiPasswd"
void setup()
{
myIP_provider.begin();
WiFi.begin(SECRET_SSID, SECRET_PASS);
}
void loop()
{
myIP_provider.run(1);
}
Notes and Warnings
Examples can be found in the Arduino IDE menu:
File -> Examples -> CANIP->
See also
Find more details here: