示例#1
0
 def GeneratePlaylistEntry(self):
     return Message.File(self.message,
                         file_label=self.file_label,
                         partition=self.partition)
示例#2
0
#
# playlist.py
# John O'Neil
# Wednesday, March 13th 2013
#
# Exercise the playlist commands in JetFileII protocol
#
#******************************************************************************

import serial
from JetFileII import Message
import time

msgs = []
msgs.append(
    Message.File('Today:{mm/dd/yy}{nl}{hhmin_12hr}:{sec}',
                 file_label='time.TXT'))
msgs.append(Message.File('WEATHER', file_label='WEATHER.TXT'))
#msgs.append( Message.File('NEWS',file_label='NEWS.TXT') )
#msgs.append( Message.File('SPORTS',file_label='SPORTS.TXT') )

playlist = Message.WriteSystemFile(Message.Playlist(msgs))

#print "Playlist is: " + playlist.encode('hex')
#print playlist

port = '/dev/ttyS0'
baudRate = 19200
ser = serial.Serial(port, baudRate)

time.sleep(1)