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