-
Notifications
You must be signed in to change notification settings - Fork 131
Improvements to FreeJ2ME's game compatibility by adding some missing classes (redone) #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
3ee6a3c
35cb096
255da6a
f34c901
ac0f2dc
0522ab4
2086bc4
f9f113f
dc1e467
424df51
d242d61
30ea5f0
c14d5c4
2f6ca2c
4e0cab9
08f6a91
c40e573
bcd09cc
25da782
805b073
5dda662
83fe551
929af84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| public abstract class DeviceClass | ||
| { | ||
|
|
||
| public DeviceClass(int record) { System.out.println("DeviceClass record:" + record); } | ||
|
|
||
| public abstract int getMajorDeviceClass(); | ||
|
|
||
| public abstract int getMinorDeviceClass(); | ||
|
|
||
| public abstract int getServiceClasses(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| public abstract class DiscoveryAgent | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this declared abstract?
|
||
| { | ||
|
|
||
| public static final int CACHED = 0; | ||
|
|
||
| public static final int GIAC = 10390323; | ||
|
|
||
| public static final int LIAC = 10390272; | ||
|
|
||
| public static final int NOT_DISCOVERABLE = 0; | ||
|
|
||
| public static final int PREKNOWN = 1; | ||
|
|
||
| public abstract boolean cancelInquiry(DiscoveryListener listener); | ||
|
|
||
| public abstract boolean cancelServiceSearch(int transID); | ||
|
|
||
| public abstract RemoteDevice[] retrieveDevices(int option); | ||
|
|
||
| public abstract int searchServices(int[] attrSet, UUID[] uuidSet, RemoteDevice btDev, DiscoveryListener discListener); | ||
|
|
||
| public abstract String selectService(UUID uuid, int security, boolean master); | ||
|
|
||
| public abstract boolean startInquiry(int accessCode, DiscoveryListener listener); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| public abstract interface DiscoveryListener | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this declared abstract? |
||
| { | ||
|
|
||
| public static int INQUIRY_COMPLETED = 0; | ||
|
|
||
| public static int INQUIRY_ERROR = 7; | ||
|
|
||
| public static int INQUIRY_TERMINATED = 5; | ||
|
|
||
| public static int SERVICE_SEARCH_COMPLETED = 1; | ||
|
|
||
| public static int SERVICE_SEARCH_DEVICE_NOT_REACHABLE = 6; | ||
|
|
||
| public static int SERVICE_SEARCH_ERROR = 3; | ||
|
|
||
| public static int SERVICE_SEARCH_NO_RECORDS = 4; | ||
|
|
||
| public static int SERVICE_SEARCH_TERMINATED = 2; | ||
|
|
||
| public abstract void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod); | ||
|
|
||
| public abstract void inquiryCompleted(int discType); | ||
|
|
||
| public abstract void servicesDiscovered(int transID, ServiceRecord[] servRecord); | ||
|
|
||
| public abstract void serviceSearchCompleted(int transID, int respCode); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import javax.microedition.io.Connection; | ||
|
|
||
| public interface L2CAPConnection extends Connection | ||
| { | ||
|
|
||
| public static final int DEFAULT_MTU = 672; | ||
|
|
||
| public static final int MINIMUM_MTU = 48; | ||
|
|
||
| public int getTransmitMTU() throws IOException; | ||
|
|
||
| public int getReceiveMTU() throws IOException; | ||
|
|
||
| public void send(byte[] data) throws IOException; | ||
|
|
||
| public int receive(byte[] inBuf) throws IOException; | ||
|
|
||
| public boolean ready() throws IOException; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import javax.microedition.io.Connection; | ||
|
|
||
| public interface L2CAPConnectionNotifier extends Connection | ||
| { | ||
|
|
||
| public L2CAPConnection acceptAndOpen() throws IOException; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| import javax.microedition.io.Connection; | ||
|
|
||
|
|
||
| public abstract class LocalDevice | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this declared abstract? |
||
| { | ||
| public abstract String getBluetoothAddress(); | ||
|
|
||
| public abstract DeviceClass getDeviceClass(); | ||
|
|
||
| public abstract int getDiscoverable(); | ||
|
|
||
| public abstract DiscoveryAgent getDiscoveryAgent(); | ||
|
|
||
| public abstract String getFriendlyName(); | ||
|
|
||
| public abstract LocalDevice getLocalDevice(); | ||
|
|
||
| public abstract String getProperty(String property); | ||
|
|
||
| public abstract ServiceRecord getRecord(Connection notifier); | ||
|
|
||
| public static boolean isPowerOn() { return false; /* We won't have functional Bluetooth yet */ } | ||
|
|
||
| public abstract boolean setDiscoverable(int mode); | ||
|
|
||
| public abstract void updateRecord(ServiceRecord srvRecord); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
|
|
||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.bluetooth; | ||
|
|
||
| public abstract class UUID | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this declared abstract? https://docs.oracle.com/javame/config/cldc/opt-pkgs/api/bluetooth/jsr082/javax/bluetooth/UUID.html |
||
| { | ||
| public UUID(long uuidValue) { System.out.println("UUID Value:" + uuidValue); } | ||
|
|
||
| public UUID(String uuidValue, boolean shortUUID) { System.out.println("UUID Value:" + uuidValue); } | ||
|
|
||
| public abstract boolean equals(Object value); | ||
|
|
||
| public abstract int hashCode(); | ||
|
|
||
| public abstract String toString(); | ||
| } | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it doesn't really matter in Java, there's no reason not to add a newline at the end. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.microedition.io.file; | ||
|
|
||
| public class ConnectionClosedException extends RuntimeException | ||
| { | ||
| public ConnectionClosedException() {} | ||
|
|
||
| public ConnectionClosedException(String detailMessage) { System.out.println("ConnectionClosedException: " + detailMessage); } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /* | ||
| This file is part of FreeJ2ME. | ||
|
|
||
| FreeJ2ME is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| FreeJ2ME is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
| */ | ||
| package javax.microedition.io.file; | ||
|
|
||
| import java.io.DataInputStream; | ||
| import java.io.DataOutputStream; | ||
| import java.io.InputStream; | ||
| import java.io.OutputStream; | ||
| import java.util.Enumeration; | ||
|
|
||
| import javax.microedition.io.StreamConnection; | ||
|
|
||
| public interface FileConnection extends StreamConnection | ||
| { | ||
| public long availableSize(); | ||
|
|
||
| public boolean canRead(); | ||
|
|
||
| public boolean canWrite(); | ||
|
|
||
| public void create(); | ||
|
|
||
| public void delete(); | ||
|
|
||
| public long directorySize(boolean includeSubDirs); | ||
|
|
||
| public boolean exists(); | ||
|
|
||
| public long fileSize(); | ||
|
|
||
| public String getName(); | ||
|
|
||
| public String getPath(); | ||
|
|
||
| public String getURL(); | ||
|
|
||
| public boolean isDirectory(); | ||
|
|
||
| public boolean isHidden(); | ||
|
|
||
| public boolean isOpen(); | ||
|
|
||
| public long lastModified(); | ||
|
|
||
| public Enumeration list(); | ||
|
|
||
| public Enumeration list(String filter, boolean includeHidden); | ||
|
|
||
| public void mkdir(); | ||
|
|
||
| public DataInputStream openDataInputStream(); | ||
|
|
||
| public DataOutputStream openDataOutputStream(); | ||
|
|
||
| public InputStream openInputStream(); | ||
|
|
||
| public OutputStream openOutputStream(); | ||
|
|
||
| public OutputStream openOutputStream(long byteOffset); | ||
|
|
||
| public void rename(); | ||
|
|
||
| public void setFileConnection(String fileName); | ||
|
|
||
| public void setHidden(boolean hidden); | ||
|
|
||
| public void setReadable(boolean readable); | ||
|
|
||
| public void setWritable(boolean writable); | ||
|
|
||
| public long totalSize(); | ||
|
|
||
| public void truncate(long byteOffset); | ||
|
|
||
| public long usedSize(); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it doesn't really matter in Java, there's no reason not to add a newline at the end. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this declared abstract?
https://docs.oracle.com/javame/config/cldc/opt-pkgs/api/bluetooth/jsr082/javax/bluetooth/DeviceClass.html