# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_pyupm_gprs', [dirname(__file__)])
        except ImportError:
            import _pyupm_gprs
            return _pyupm_gprs
        if fp is not None:
            try:
                _mod = imp.load_module('_pyupm_gprs', fp, pathname, description)
            finally:
                fp.close()
            return _mod
    _pyupm_gprs = swig_import_helper()
    del swig_import_helper
else:
    import _pyupm_gprs
del version_info
try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    if (not static):
        return object.__getattr__(self, name)
    else:
        raise AttributeError(name)
def _swig_getattr(self, class_type, name):
    return _swig_getattr_nondynamic(self, class_type, name, 0)
def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
    _object = object
    _newclass = 1
except AttributeError:
    class _object:
        pass
    _newclass = 0
def getVersion():
    return _pyupm_gprs.getVersion()
getVersion = _pyupm_gprs.getVersion
_pyupm_gprs.GPRS_DEFAULT_UART_swigconstant(_pyupm_gprs)
GPRS_DEFAULT_UART = _pyupm_gprs.GPRS_DEFAULT_UART
[docs]class GPRS(_object):
    """
    API for the GPRS Module.
    ID: gprs
    Name: General Packet Radio Service ( GPRS) Module
    Other Names: Grove GPRS Module
    Category: wifi
    Manufacturer: seeed
    Connection: uart
    Link:http://www.seeedstudio.com/wiki/GPRS_Shield_V2.0  The driver was
    tested with the GPRS Module, V2. It's a GSM GPRS module based on the
    SIM900. This module uses a standard 'AT' command set. See the
    datasheet for a full list of available commands and their possible
    responses:
    http://www.seeedstudio.com/wiki/images/7/72/AT_Commands_v1.11.pdf
    It is connected via a UART at 19200 baud.
    C++ includes: gprs.hpp 
    """
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, GPRS, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, GPRS, name)
    __repr__ = _swig_repr
    def __init__(self, uart=0):
        """
        GPRS(int
        uart=GPRS_DEFAULT_UART)
        GPRS object constructor
        Parameters:
        -----------
        uart:  Default UART to use (0 or 1). Default is 0. 
        """
        this = _pyupm_gprs.new_GPRS(uart)
        try:
            self.this.append(this)
        except Exception:
            self.this = this
    __swig_destroy__ = _pyupm_gprs.delete_GPRS
    __del__ = lambda self: None
[docs]    def dataAvailable(self, millis):
        """
        bool
        dataAvailable(unsigned int millis)
        Checks to see if there is data available for reading
        Parameters:
        -----------
        millis:  Number of milliseconds to wait; 0 means no waiting
        true if there is data available for reading 
        """
        return _pyupm_gprs.GPRS_dataAvailable(self, millis) 
[docs]    def readData(self, buffer, len):
        """
        int readData(char
        *buffer, unsigned int len)
        Reads any available data into a user-supplied buffer. Note: the call
        blocks until data is available for reading. Use dataAvailable() to
        determine whether there is data available beforehand, to avoid
        blocking.
        Parameters:
        -----------
        buffer:  Buffer to hold the data read
        len:  Length of the buffer
        Number of bytes read 
        """
        return _pyupm_gprs.GPRS_readData(self, buffer, len) 
[docs]    def readDataStr(self, len):
        """
        std::string
        readDataStr(int len)
        Reads any available data and returns it in a std::string. Note: the
        call blocks until data is available for reading. Use dataAvailable()
        to determine whether there is data available beforehand, to avoid
        blocking.
        Parameters:
        -----------
        len:  Maximum length of the data to be returned
        Number of bytes read 
        """
        return _pyupm_gprs.GPRS_readDataStr(self, len) 
[docs]    def writeData(self, buffer, len):
        """
        int writeData(char
        *buffer, unsigned len)
        Writes the data in the buffer to the device. If you are writing a
        command, be sure to terminate it with a carriage return ()
        Parameters:
        -----------
        buffer:  Buffer to hold the data to write
        len:  Length of the buffer
        Number of bytes written 
        """
        return _pyupm_gprs.GPRS_writeData(self, buffer, len) 
[docs]    def writeDataStr(self, data):
        """
        int
        writeDataStr(std::string data)
        Writes the std:string data to the device. If you are writing a
        command, be sure to terminate it with a carriage return ()
        Parameters:
        -----------
        data:  Buffer to write to the device
        Number of bytes written 
        """
        return _pyupm_gprs.GPRS_writeDataStr(self, data) 
[docs]    def setBaudRate(self, baud=19200):
        """
        int setBaudRate(int
        baud=19200)
        Sets the baud rate for the device. The default is 19200.
        Parameters:
        -----------
        baud:  Desired baud rate.
        true if successful 
        """
        return _pyupm_gprs.GPRS_setBaudRate(self, baud)  
GPRS_swigregister = _pyupm_gprs.GPRS_swigregister
GPRS_swigregister(GPRS)
[docs]class charArray(_object):
    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, charArray, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, charArray, name)
    __repr__ = _swig_repr
    def __init__(self, nelements):
        this = _pyupm_gprs.new_charArray(nelements)
        try:
            self.this.append(this)
        except Exception:
            self.this = this
    __swig_destroy__ = _pyupm_gprs.delete_charArray
    __del__ = lambda self: None
    def __getitem__(self, index):
        return _pyupm_gprs.charArray___getitem__(self, index)
    def __setitem__(self, index, value):
        return _pyupm_gprs.charArray___setitem__(self, index, value)
[docs]    def cast(self):
        return _pyupm_gprs.charArray_cast(self) 
    __swig_getmethods__["frompointer"] = lambda x: _pyupm_gprs.charArray_frompointer
    if _newclass:
        frompointer = staticmethod(_pyupm_gprs.charArray_frompointer) 
charArray_swigregister = _pyupm_gprs.charArray_swigregister
charArray_swigregister(charArray)
def charArray_frompointer(t):
    return _pyupm_gprs.charArray_frompointer(t)
charArray_frompointer = _pyupm_gprs.charArray_frompointer
# This file is compatible with both classic and new-style classes.