3333 Check out README.md for more info.
3434*/
3535
36- class EthernetSSLClient : public Client
36+ class EthernetSSLClient : public Client
3737{
3838 public:
3939 /* *
@@ -44,7 +44,7 @@ class EthernetSSLClient : public Client
4444 checking the errors, you can do so with EthernetSSLClient::getWriteError(),
4545 which will return one of these values.
4646 */
47- enum Error
47+ enum Error
4848 {
4949 SSL_OK = 0 ,
5050 /* * The underlying client failed to connect, probably not an issue with SSL */
@@ -67,7 +67,7 @@ class EthernetSSLClient : public Client
6767 Use these values when initializing EthernetSSLClient to set how many logs you
6868 would like to see in the Serial monitor.
6969 */
70- enum DebugLevel
70+ enum DebugLevel
7171 {
7272 /* * No logging output */
7373 SSL_NONE = 0 ,
@@ -212,9 +212,9 @@ class EthernetSSLClient : public Client
212212 fails to become ready for writing data.
213213 */
214214 size_t write (const uint8_t *buf, size_t size) override ;
215-
215+
216216 /* * @see EthernetSSLClient::write(uint8_t*, size_t) */
217- size_t write (uint8_t b) override
217+ size_t write (uint8_t b) override
218218 {
219219 return write (&b, 1 );
220220 }
@@ -265,10 +265,10 @@ class EthernetSSLClient : public Client
265265 @brief Read a single byte, or -1 if none is available.
266266 @see EthernetSSLClient::read(uint8_t*, size_t)
267267 */
268- int read () override
268+ int read () override
269269 {
270270 uint8_t read_val;
271-
271+
272272 return read (&read_val, 1 ) > 0 ? read_val : -1 ;
273273 };
274274
@@ -361,7 +361,7 @@ class EthernetSSLClient : public Client
361361
362362 @returns The SessionCache template parameter.
363363 */
364- size_t getSessionCount () const
364+ size_t getSessionCount () const
365365 {
366366 return m_sessions.size ();
367367 }
@@ -371,13 +371,13 @@ class EthernetSSLClient : public Client
371371
372372 @returns true if connected, false if not
373373 */
374- operator bool ()
374+ operator bool ()
375375 {
376376 return connected () > 0 ;
377377 }
378378
379379 /* * @brief Returns a reference to the client object stored in this class. Take care not to break it. */
380- Client& getClient ()
380+ Client& getClient ()
381381 {
382382 return m_client;
383383 }
@@ -386,7 +386,7 @@ class EthernetSSLClient : public Client
386386 @brief Set the timeout when waiting for an SSL response.
387387 @param t The timeout value, in milliseconds (defaults to 30 seconds if not set). Do not set to zero.
388388 */
389- void setTimeout (unsigned int t)
389+ void setTimeout (unsigned int t)
390390 {
391391 m_timeout = t;
392392 }
@@ -395,33 +395,33 @@ class EthernetSSLClient : public Client
395395 @brief Get the timeout when waiting for an SSL response.
396396 @returns The timeout value in milliseconds.
397397 */
398- unsigned int getTimeout () const
398+ unsigned int getTimeout () const
399399 {
400400 return m_timeout;
401401 }
402-
403- /* *
404- @brief Change the time used during x509 verification to a different value.
405402
406- This function directly calls br_x509_minimal_set_time to change the validation
407- time used by the minimal verification engine. You can use this function if the default value
408- of the compile time is causing issues. See https://bearssl.org/apidoc/bearssl__x509_8h.html#a7f3558b1999ce904084d578700b1002c
409- for more information what this function does and how to use it.
403+ /* *
404+ @brief Change the time used during x509 verification to a different value.
410405
411- @param days Days are counted in a proleptic Gregorian calendar since January 1st, 0 AD.
412- @param seconds Seconds are counted since midnight, from 0 to 86400 (a count of 86400 is possible only if a leap second happened).
406+ This function directly calls br_x509_minimal_set_time to change the validation
407+ time used by the minimal verification engine. You can use this function if the default value
408+ of the compile time is causing issues. See https://bearssl.org/apidoc/bearssl__x509_8h.html#a7f3558b1999ce904084d578700b1002c
409+ for more information what this function does and how to use it.
410+
411+ @param days Days are counted in a proleptic Gregorian calendar since January 1st, 0 AD.
412+ @param seconds Seconds are counted since midnight, from 0 to 86400 (a count of 86400 is possible only if a leap second happened).
413413 */
414-
414+
415415 void setVerificationTime (uint32_t days, uint32_t seconds);
416416
417417 private:
418418 /* * @brief Returns an instance of m_client that is polymorphic and can be used by EthernetSSLClient */
419- Client& get_arduino_client ()
419+ Client& get_arduino_client ()
420420 {
421421 return m_client;
422422 }
423-
424- const Client& get_arduino_client () const
423+
424+ const Client& get_arduino_client () const
425425 {
426426 return m_client;
427427 }
@@ -451,12 +451,12 @@ class EthernetSSLClient : public Client
451451
452452 /* * @brief debugging print function, only prints if m_debug is true */
453453 template <typename T>
454- void m_print (const T str, const char * func_name, const DebugLevel level) const
454+ void m_print (const T str, const char * func_name, const DebugLevel level) const
455455 {
456456 // check the current debug level and serial status
457- if (level > m_debug || !Serial)
457+ if (level > m_debug || !Serial)
458458 return ;
459-
459+
460460 // print prefix
461461 m_print_prefix (func_name, level);
462462 // print the message
@@ -465,19 +465,19 @@ class EthernetSSLClient : public Client
465465
466466 /* * @brief Prints a info message to serial, if info messages are enabled */
467467 template <typename T>
468- void m_info (const T str, const char * func_name) const
468+ void m_info (const T str, const char * func_name) const
469469 {
470470 m_print (str, func_name, SSL_INFO);
471471 }
472472
473473 template <typename T>
474- void m_warn (const T str, const char * func_name) const
474+ void m_warn (const T str, const char * func_name) const
475475 {
476476 m_print (str, func_name, SSL_WARN);
477477 }
478478
479479 template <typename T>
480- void m_error (const T str, const char * func_name) const
480+ void m_error (const T str, const char * func_name) const
481481 {
482482 m_print (str, func_name, SSL_ERROR);
483483 }
@@ -487,7 +487,7 @@ class EthernetSSLClient : public Client
487487 // ============================================
488488 // create a reference the client
489489 Client& m_client;
490-
490+
491491 // also store an array of SSLSessions, so we can resume communication with multiple websites
492492 std::vector<SSLSession> m_sessions;
493493 // as well as the maximmum number of sessions we can store
@@ -520,7 +520,7 @@ class EthernetSSLClient : public Client
520520 unsigned char m_iobuf[2048 ];
521521 // unsigned char m_iobuf[4096];
522522 // ////
523-
523+
524524 // store the index of where we are writing in the buffer
525525 // so we can send our records all at once to prevent
526526 // weird timing issues
0 commit comments