table [, error] = peripheral:getServices()
Returns a table containing the list of services discovered which can be traversed with the help of the ipairs function. An empty table is returned if no services were discovered or if getServices gets called before the service discovery procedure completes. In case of an error, nil is returned together with an error message.
Parameter |
Type |
Description |
---|---|---|
table |
out table |
A table containing the
discovered services otherwise nil |
error |
out string (optional) |
If successful nil is returned, an error message otherwise |
Introduced in platform.apiLevel = '2.5'