Kallisto Linux API
Library for interacting with Kallisto devices
kallisto_error.hpp File Reference
#include <string>
#include <sstream>
Include dependency graph for kallisto_error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  KallistoDetailedResult
 Class that encapsulates a result. More...
 

Macros

#define KALLISTO_ERROR_HPP_
 
#define KALLISTO_ERROR_HANDLER(ERR_CODE)
 
#define KALLISTO_ERROR_CHECK(ERR_CODE)
 

Enumerations

enum  KallistoResult {
  SUCCESS, ERROR_INTERNAL, ERROR_NO_MEM, ERROR_NOT_FOUND,
  ERROR_NOT_SUPPORTED, ERROR_INVALID_PARAM, ERROR_INVALID_STATE, ERROR_INVALID_LENGTH,
  ERROR_INVALID_FLAGS, ERROR_INVALID_DATA, ERROR_DATA_SIZE, ERROR_TIMEOUT,
  ERROR_NULL, ERROR_FORBIDDEN, ERROR_INVALID_ADDR, ERROR_BUSY,
  ERROR_BLUETOOTH_ADAPTER, ERROR_BLUETOOTH_DEVICE
}
 Set of error code defines. More...
 

Functions

void kallisto_error_handler (unsigned int &error_code, const char *file, unsigned int line, const char *function)
 

Detailed Description

Copyright (c) 2019, Sensry GmbH

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form, except as embedded into a Sensry GmbH integrated circuit in a product or a software update for such product, must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Sensry GmbH nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  4. This software, with or without modification, must only be used with a Sensry GmbH integrated circuit.
  5. Any software provided in binary form under this license must not be reverse engineered, decompiled, modified and/or disassembled.

THIS SOFTWARE IS PROVIDED BY SENSRY GMBH "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SENSRY GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ KALLISTO_ERROR_CHECK

#define KALLISTO_ERROR_CHECK (   ERR_CODE)

Macro for calling error handler function if supplied error code any other than KALLISTO_SUCCESS.

Parameters
[in]ERR_CODEError code supplied to the error handler.

◆ KALLISTO_ERROR_HANDLER

#define KALLISTO_ERROR_HANDLER (   ERR_CODE)

Macro for calling error handler function.

Parameters
[in]ERR_CODEError code supplied to the error handler.

Enumeration Type Documentation

◆ KallistoResult

enum KallistoResult

Set of error code defines.

Enumerator
SUCCESS 

Successful command.

ERROR_INTERNAL 

Internal Error.

ERROR_NO_MEM 

No Memory for operation.

ERROR_NOT_FOUND 

Not found.

ERROR_NOT_SUPPORTED 

Not supported.

ERROR_INVALID_PARAM 

Invalid Parameter.

ERROR_INVALID_STATE 

Invalid state, operation disallowed in this state.

ERROR_INVALID_LENGTH 

Invalid Length.

ERROR_INVALID_FLAGS 

Invalid Flags.

ERROR_INVALID_DATA 

Invalid Data.

ERROR_DATA_SIZE 

Data size exceeds limit.

ERROR_TIMEOUT 

Operation timed out.

ERROR_NULL 

Null Pointer.

ERROR_FORBIDDEN 

Forbidden Operation.

ERROR_INVALID_ADDR 

Bad Memory Address.

ERROR_BUSY 

Busy.

ERROR_BLUETOOTH_ADAPTER 

BLE Adapter operation error.

ERROR_BLUETOOTH_DEVICE 

BLE Device operation error.

Function Documentation

◆ kallisto_error_handler()

void kallisto::error::kallisto_error_handler ( unsigned int &  error_code,
const char *  file,
unsigned int  line,
const char *  function 
)

Function for error handling, which is called when an error has occurred. To be used with the macro KALLISTO_ERROR_CHECK.

Parameters
[in]error_codeError code supplied to the handler.
[in]line_numLine number where the handler is called.
[in]p_file_namePointer to the file name.