Ejemplo n.º 1
0
#!/usr/bin/env python

import sys, socket

import time

from m3_common import m3_common, goc_programmer

import m3_logging

logger = m3_logging.get_logger(__name__)
logger.debug('Got goc.py logger')


class goc_programmer_for_i2c(goc_programmer):
    MSG_TYPE = 'd+'

    def send(self, addr, data):
        return self.ice.i2c_send(ord(addr), data)

    def validate_bin(self):
        junk_dma_done_msg = "%08X" % (socket.htonl(0x20000000))
        logger.info(
            "Sending junk message (DMA Done, 0 bytes to addr 0) to ensure chip is awake"
        )
        logger.debug("Sending: 0xAA " + junk_dma_done_msg)
        ice.i2c_send(0xaa, junk_dma_done_msg.decode('hex'))
        sleep(1.0)
        super(goc_programmer_for_i2c, self).validate_bin()

Ejemplo n.º 2
0
#!/usr/bin/env python

import sys, socket

import time

from m3_common import m3_common, goc_programmer

import m3_logging
logger = m3_logging.get_logger(__name__)
logger.debug('Got goc.py logger')

class goc_programmer_for_i2c(goc_programmer):
    MSG_TYPE = 'd+'

    def send(self, addr, data):
        return self.ice.i2c_send(ord(addr), data)

    def validate_bin(self):
        junk_dma_done_msg = "%08X" % (socket.htonl(0x20000000))
        logger.info("Sending junk message (DMA Done, 0 bytes to addr 0) to ensure chip is awake")
        logger.debug("Sending: 0xAA " + junk_dma_done_msg)
        ice.i2c_send(0xaa, junk_dma_done_msg.decode('hex'))
        sleep(1.0)
        super(goc_programmer_for_i2c, self).validate_bin()

class goc_programmer_for_mbus(goc_programmer):
    MSG_TYPE = 'b+'

    def add_parse_args(self):
        super(goc_programmer_for_mbus, self).add_parse_args()
Ejemplo n.º 3
0
#!/usr/bin/python

import os
import sys
import logging

from m3_common import m3_common

#m3_common.configure_root_logger()
#logger = logging.getLogger(__name__)

from m3_logging import get_logger
logger = get_logger(__name__)

class mbus_message_generator(m3_common):
    TITLE = "MBus Message Generator"

    def __init__(self):
        super(mbus_message_generator,self).__init__()
        self.count=0
    
    def add_parse_args(self):
        super(mbus_message_generator, self).add_parse_args(require_binfile=False)
        self.parser.add_argument('-fc','--filename_cref')
        self.parser.add_argument('-fo','--filename_outp')
        self.parser.add_argument('-k','--killcount',default=1e6,type=float)

    def parse_args(self):
        super(mbus_message_generator, self).parse_args()

    def install_handler(self):
Ejemplo n.º 4
0
import os
import sys
import logging
import csv

import time
import datetime
from datetime import datetime

from m3_common import m3_common

#m3_common.configure_root_logger()
#logger = logging.getLogger(__name__)

from m3_logging import get_logger
logger = get_logger(__name__)

logfile = open('mbus_snoop_log.txt', 'w')

wr = csv.writer(open('snsv7_snoop.txt', 'w'),
                delimiter=',',
                lineterminator='\n')
wr.writerow(['DATE', 'TIME', 'C_MEAS', 'C_REF', 'C_REV', 'C_PAR'])


class mbus_message_generator(m3_common):
    TITLE = "MBus Message Generator"

    def __init__(self):
        super(mbus_message_generator, self).__init__()
        self.count = 0