Update HS_STATUS.md

This commit is contained in:
HomeSpan 2022-11-05 11:48:15 -04:00 committed by GitHub
parent 39850c17cb
commit 6763b2a79b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# HomeSpan Status # HomeSpan Status
The optional *homeSpan* method, `void setStatusCallback(void (*func)(HS_STATUS status))`, can be used to create a callback function, *func*, that HomeSpan calls whenever its status changes. HomeSpan passes *func* a single argument, *status*, of type *HS_STATUS*, defined as follows: The optional ***homeSpan*** method, `void setStatusCallback(void (*func)(HS_STATUS status))`, can be used to create a callback function, *func*, that HomeSpan calls whenever its status changes. HomeSpan passes *func* a single argument, *status*, of type *HS_STATUS*, defined as follows:
```C++ ```C++
enum HS_STATUS { enum HS_STATUS {
@ -28,7 +28,7 @@ enum HS_STATUS {
}; };
``` ```
The *homeSpan* method `char* statusString(HS_STATUS s)`, is a convenience function for converting any of the above enumerations to short, pre-defined character string messages as follows: The ***homeSpan*** method `char* statusString(HS_STATUS s)`, is a convenience function for converting any of the above enumerations to short, pre-defined character string messages as follows:
```C++ ```C++
const char* Span::statusString(HS_STATUS s){ const char* Span::statusString(HS_STATUS s){
@ -59,6 +59,8 @@ const char* Span::statusString(HS_STATUS s){
} }
``` ```
You can of course create any alternative messsages, or take any actions desired, in *func* and do not need to use the pre-defined strings above.
--- ---
[↩️](Reference.md) Back to the Reference API page [↩️](Reference.md) Back to the Reference API page