def get_shuffle():
    return mkcmd(4, "002C")
示例#2
0
def select_button():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x80))
示例#3
0
def scroll_down():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x0) + chr(0x2))
示例#4
0
def toggle_repeat():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x1))
示例#5
0
def on():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x8))
示例#6
0
def release_button():
    return mkcmd(2, chr(0x0) + chr(0x0))
示例#7
0
def previous_playlist():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x40))
def set_song_in_playlist(song = 0):
    return mkcmd(4, "0037" + inttohexstr(song))
#!/usr/bin/env python


import general
import serial
import time
import advanceddock
import struct
from general import *
serialPort = "/dev/tty.usbserial"

ser = serial.Serial(serialPort, baudrate=19200, timeout=1)

ser.write(general.mkcmd(0, "0104")) # Set iPod in AIR mode.
res = readResponse(ser)


ser.write(advanceddock.set_pulling_mode(1))
ser.write(advanceddock.switch_to_type(5,0))

while True:
    if ser.inWaiting():
        res = readResponse(ser, fullMessage=True)
        print res
示例#10
0
def set_repeat(mode = 0):
    return mkcmd(4, "0031" + inttohexstr(mode, 1))
示例#11
0
def get_playlist_songs():
    return mkcmd(4, "0035")
示例#12
0
def get_repeat():
    return mkcmd(4, "002F")
示例#13
0
def set_shuffle(mode = 0):
    return mkcmd(4, "002E" + inttohexstr(mode, 1))
示例#14
0
def get_ipod_name():
    return mkcmd(4, "0014")
示例#15
0
def pause_only():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x2))
示例#16
0
def volume_up():
    return mkcmd(2, chr(0x0) + chr(0x2))
示例#17
0
def toggle_mute():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x4))
示例#18
0
def volume_down():
    return mkcmd(2, chr(0x0) + chr(0x4))
示例#19
0
def next_playlist():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x20))
示例#20
0
def skip_forward():
    return mkcmd(2, chr(0x0) + chr(0x8))
示例#21
0
def toggle_shuffle():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x80))
示例#22
0
def skip_backwards():
    return mkcmd(2, chr(0x0) + chr(0x10))
示例#23
0
def off():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x4))
示例#24
0
def next_album():
    return mkcmd(2, chr(0x0) + chr(0x20))
示例#25
0
def menu_button():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x40))
示例#26
0
def previous_album():
    return mkcmd(2, chr(0x0) + chr(0x40))
示例#27
0
def scroll_up():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x0) + chr(0x1))
示例#28
0
def stop():
    return mkcmd(2, chr(0x0) + chr(0x80))
示例#29
0
def play():
    return mkcmd(2, chr(0x0) + chr(0x1))
示例#30
0
def raw_control(cmd = 1):
    return mkcmd(4, "0029" + inttohexstr(cmd, 1))