Ejemplo n.º 1
0
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import const
import logging
import logging.handlers
import os, sys, time
from django.conf import settings

try:
    from net.aircable.utils import logger
except:
    import logging
    logger = logging.getLogger('sensorsdk')
    logger.setLevel(logging.DEBUG)
    c = logging.StreamHandler()
    c.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
    logger.addHandler(c)


def isAIRcable(address):
    return address[:8].upper() in const.AIRCABLE_MAC


def getDefaultSettings():
    return {'MEDIA_ROOT': '/tmp/aircable', 'TIMEOUT': 15}


#settings storing
def store_settings():
    keys = getDefaultSettings()

    try:
Ejemplo n.º 2
0
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import const
import logging
import logging.handlers
import os, sys, time
from django.conf import settings

try:
    from net.aircable.utils import logger
except:
    import logging
    logger = logging.getLogger('sensorsdk')
    logger.setLevel(logging.DEBUG)
    c = logging.StreamHandler()
    c.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
    logger.addHandler(c)

def isAIRcable(address):
	return address[:8].upper() in const.AIRCABLE_MAC    

def getDefaultSettings():
    return {
	'MEDIA_ROOT': 	'/tmp/aircable',
	'TIMEOUT':	15
    }

#settings storing
def store_settings():
	keys = getDefaultSettings()
	
	try:
Ejemplo n.º 3
0
import dbus

from re import compile
from errors import *
from select import select

try:
    from net.aircable.utils import logger
except:
    import logging
    logger = logging.getLogger('sppAIRcable')

    console = logging.StreamHandler()
    formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
    console.setFormatter(formatter)
    logger.addHandler(console)
    logger.setLevel(logging.DEBUG)


class sppBase:
	'''
	    Base class for rfcomm wrappers regardless of it\'s master or slave
	    behaviour.
	'''
        socket  = None;
        channel = None;
	service = None;
	device  = None;
	
	bus 	  = dbus.SystemBus();
	__pattern = compile(r'.*\n');
Ejemplo n.º 4
0
import dbus

from re import compile
from errors import *
from select import select

try:
    from net.aircable.utils import logger
except:
    import logging
    logger = logging.getLogger('sppAIRcable')

    console = logging.StreamHandler()
    formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
    console.setFormatter(formatter)
    logger.addHandler(console)
    logger.setLevel(logging.DEBUG)


class sppBase:
    '''
	    Base class for rfcomm wrappers regardless of it\'s master or slave
	    behaviour.
	'''
    socket = None
    channel = None
    service = None
    device = None

    bus = dbus.SystemBus()
    __pattern = compile(r'.*\n')