Esempio n. 1
0
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import print_function
from cclib import hexdump, renderDebugStatus, renderDebugConfig, getOptions, openCCDebugger
import sys

# Get serial port either form environment or from arguments
opts = getOptions("Generic CCDebugger Information Tool")

# Open debugger
try:
    dbg = openCCDebugger(opts['port'], enterDebug=opts['enter'])
except Exception as e:
    print("ERROR: %s" % str(e))
    sys.exit(1)

# Get device information from the read-only section
print("\nDevice information:")
print(" IEEE Address : %s" % dbg.getSerial())
print("           PC : %04x" % dbg.getPC())

print("\nDebug status:")
renderDebugStatus(dbg.debugStatus)
print("\nDebug config:")
renderDebugConfig(dbg.debugConfig)

# Done
print("")
Esempio n. 2
0
# Get serial port either form environment or from arguments
opts = getOptions("BlueGiga-Specific CCDebugger Information Tool")

# Open debugger
try:
	dbg = openCCDebugger(opts['port'], enterDebug=opts['enter'], driver=BlueGigaCCDebugger)
except Exception as e:
	print("ERROR: %s" % str(e))
	sys.exit(1)

# Get device information from the read-only section
print("\nDevice information:")
print(" IEEE Address : %s" % dbg.getSerial())
print("           PC : %04x" % dbg.getPC())

# Get bluegiga-specific info
binfo = dbg.getBLEInfo()
print("\nFirmware information:")
print("      License : %s" % binfo['license'])
print("   BT Address : %s" % binfo['btaddr'])
print(" Hardware Ver : %02x" % binfo['hwver'])

print("\nDebug status:")
renderDebugStatus(dbg.debugStatus)
print("\nDebug config:")
renderDebugConfig(dbg.debugConfig)

# Done
print("")