#!/usr/bin/env python
# coding=utf-8

import ctypes
import ctypes.util
import collections

libneo = ctypes.cdll.LoadLibrary(ctypes.util.find_library('neo'))

libneo.neo_get_version.restype = ctypes.c_int32
libneo.neo_get_version.argtypes = None

libneo.neo_is_abi_compatible.restype = ctypes.c_bool
libneo.neo_is_abi_compatible.argtypes = None

libneo.neo_error_message.restype = ctypes.c_char_p
libneo.neo_error_message.argtypes = [ctypes.c_void_p]

libneo.neo_error_destruct.restype = None
libneo.neo_error_destruct.argtypes = [ctypes.c_void_p]

libneo.neo_device_construct_simple.restype = ctypes.c_void_p
libneo.neo_device_construct_simple.argtypes = [ctypes.c_char_p, ctypes.c_void_p]

libneo.neo_device_construct.restype = ctypes.c_void_p
libneo.neo_device_construct.argtypes = [ctypes.c_char_p, ctypes.c_int32, ctypes.c_void_p]

libneo.neo_device_destruct.restype = None
libneo.neo_device_destruct.argtypes = [ctypes.c_void_p]

libneo.neo_device_start_scanning.restype = None
libneo.neo_device_start_scanning.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

libneo.neo_device_stop_scanning.restype = None
libneo.neo_device_stop_scanning.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

libneo.neo_device_get_scan.restype = ctypes.c_void_p
libneo.neo_device_get_scan.argtypes = [ctypes.c_void_p, ctypes.c_void_p]

libneo.neo_scan_destruct.restype = None
libneo.neo_scan_destruct.argtypes = [ctypes.c_void_p]

libneo.neo_scan_get_number_of_samples.restype = ctypes.c_int32
libneo.neo_scan_get_number_of_samples.argtypes = [ctypes.c_void_p]

libneo.neo_scan_get_angle.restype = ctypes.c_int32
libneo.neo_scan_get_angle.argtypes = [ctypes.c_void_p, ctypes.c_int32]

libneo.neo_scan_get_distance.restype = ctypes.c_int32
libneo.neo_scan_get_distance.argtypes = [ctypes.c_void_p, ctypes.c_int32]