def get_shuffle():
    return mkcmd(4, "002C")
Beispiel #2
0
def select_button():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x80))
Beispiel #3
0
def scroll_down():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x0) + chr(0x2))
Beispiel #4
0
def toggle_repeat():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x1))
Beispiel #5
0
def on():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x8))
Beispiel #6
0
def release_button():
    return mkcmd(2, chr(0x0) + chr(0x0))
Beispiel #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
def set_repeat(mode = 0):
    return mkcmd(4, "0031" + inttohexstr(mode, 1))
def get_playlist_songs():
    return mkcmd(4, "0035")
def get_repeat():
    return mkcmd(4, "002F")
def set_shuffle(mode = 0):
    return mkcmd(4, "002E" + inttohexstr(mode, 1))
def get_ipod_name():
    return mkcmd(4, "0014")
Beispiel #15
0
def pause_only():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x2))
Beispiel #16
0
def volume_up():
    return mkcmd(2, chr(0x0) + chr(0x2))
Beispiel #17
0
def toggle_mute():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x4))
Beispiel #18
0
def volume_down():
    return mkcmd(2, chr(0x0) + chr(0x4))
Beispiel #19
0
def next_playlist():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x20))
Beispiel #20
0
def skip_forward():
    return mkcmd(2, chr(0x0) + chr(0x8))
Beispiel #21
0
def toggle_shuffle():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x80))
Beispiel #22
0
def skip_backwards():
    return mkcmd(2, chr(0x0) + chr(0x10))
Beispiel #23
0
def off():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x4))
Beispiel #24
0
def next_album():
    return mkcmd(2, chr(0x0) + chr(0x20))
Beispiel #25
0
def menu_button():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x40))
Beispiel #26
0
def previous_album():
    return mkcmd(2, chr(0x0) + chr(0x40))
Beispiel #27
0
def scroll_up():
    return mkcmd(2, chr(0x0) + chr(0x0) + chr(0x0) + chr(0x0) + chr(0x1))
Beispiel #28
0
def stop():
    return mkcmd(2, chr(0x0) + chr(0x80))
Beispiel #29
0
def play():
    return mkcmd(2, chr(0x0) + chr(0x1))
def raw_control(cmd = 1):
    return mkcmd(4, "0029" + inttohexstr(cmd, 1))