UPM support for the WT5001 Serial MP3 module. This was tested specifically with the Grove Serial MP3 module.
int cmd = -1;
if (args.length > 0)
cmd = Integer.parseInt(args[0]);
if (!mp3.setupTty()) {
System.err.println("error in loading native library");
System.exit(-1);
}
switch (cmd) {
case 0 :
break;
case 1 :
break;
case 2 :
mp3.pause();
break;
case 3 :
mp3.next();
break;
case 4 :
mp3.previous();
break;
default :
printUsage();
break;
}
try {
short vol;
vol = mp3.getVolume();
System.out.println("The current volume is: " + vol);
} catch (IOException e) {
e.printStackTrace();
}
try {
short ps;
ps = mp3.getPlayState();
System.out.println("The current play state is: " + ps);
} catch (IOException e) {
e.printStackTrace();
}
try {
int numf;
System.out.println("The number of files on the SD card is: " + numf);
} catch (IOException e) {
e.printStackTrace();
}
try {
int curf;
curf = mp3.getCurrentFile();
System.out.println("The current file is: " + curf);
} catch (IOException e) {
e.printStackTrace();
}
int year[] = new int[1];
short month[] = new short[1];
short day[] = new short[1];
if (mp3.getDate(year, month, day))
System.out.println("The device date is: " + year[0] + "/" + month[0] + "/" + day[0]);
short hour[] = new short[1];
short minute[] = new short[1];
short second[] = new short[1];
if (mp3.getTime(hour, minute, second))
System.out
.println("The device time is: " + hour[0] + ":" + minute[0] + ":" + second[0]);
|
synchronized void | delete () |
|
| WT5001 (int uart) |
|
boolean | dataAvailable (long millis) |
|
int | readData (byte[] buffer) |
|
int | writeData (byte[] buffer) |
|
boolean | setupTty (int baud) |
|
boolean | setupTty () |
|
boolean | checkResponse (WT5001.WT5001_OPCODE_T opcode) |
|
boolean | play (WT5001.WT5001_PLAYSOURCE_T psrc, int index) |
|
boolean | stop () |
|
boolean | pause () |
|
boolean | next () |
|
boolean | previous () |
|
boolean | setVolume (short vol) |
|
boolean | queue (int index) |
|
boolean | setPlayMode (WT5001.WT5001_PLAYMODE_T pm) |
|
boolean | insert (int index) |
|
boolean | setDate (int year, short month, short day) |
|
boolean | setTime (short hour, short minute, short second) |
|
boolean | setAlarm (short hour, short minute, short second) |
|
boolean | clearAlarm () |
|
short | getVolume () throws java.io.IOException |
|
short | getPlayState () throws java.io.IOException |
|
int | getNumFiles (WT5001.WT5001_PLAYSOURCE_T psrc) throws java.io.IOException |
|
int | getCurrentFile () throws java.io.IOException |
|
boolean | getDate (int[] year, short[] month, short[] day) |
|
boolean | getTime (short[] hour, short[] minute, short[] second) |
|