Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3ee6a3c
javax: microedition: rms: Truncate record IDs to 0 in some cases.
AShiningRay Jun 8, 2022
35cb096
freej2me-lr: Fix rotated pointer coordinates.
AShiningRay Jun 9, 2022
255da6a
javax: io: Implement the javax.microedition.io.file.* classes.
AShiningRay Jun 11, 2022
f34c901
javax: bluetooth: Stub some missing classes and interfaces.
AShiningRay Jun 11, 2022
ac0f2dc
javax: io: Update the file/ folder.
AShiningRay Jun 12, 2022
0522ab4
freej2me: libretro: Make the pointer position calc more readable.
AShiningRay Jun 12, 2022
2086bc4
src: javax: Stub the obex folder.
AShiningRay Jun 12, 2022
f9f113f
javax: bluetooth: Finish the file additions.
AShiningRay Jun 12, 2022
dc1e467
javax: bluetooth: Some cleanups to the files.
AShiningRay Jun 12, 2022
424df51
javax: io: Cleanups to the file/ folder.
AShiningRay Jun 12, 2022
d242d61
src: javax: Minor cleanup on the obex folder.
AShiningRay Jun 12, 2022
30ea5f0
javax: io: More cleanups and adjustments to the file/ folder.
AShiningRay Jun 14, 2022
c14d5c4
javax: obex: More adjustments to the obex files.
AShiningRay Jun 14, 2022
2f6ca2c
javax: bluetooth: Clean up LocalDevice and implement UUID
AShiningRay Jun 14, 2022
4e0cab9
Revert "Truncate record IDs to 0 in some cases."
AShiningRay Jun 22, 2022
08f6a91
javax: bluetooth: UUID: Fix some uuid conversion problems.
AShiningRay Jun 28, 2022
c40e573
javax: bluetooth: UUID: Improve the code with a few ideas.
AShiningRay Jun 29, 2022
bcd09cc
javax: bluetooth: UUID: Fixing a small typo.
AShiningRay Jun 29, 2022
25da782
javax: bluetooth: UUID: Clearing an empty line at the start.
AShiningRay Jun 29, 2022
805b073
Revert "freej2me: libretro: Make the pointer position calc more reada…
AShiningRay Jun 29, 2022
5dda662
Revert "freej2me-lr: Fix rotated pointer coordinates."
AShiningRay Jun 29, 2022
83fe551
javax: bluetooth: UUID: Fixing one of the UUID constructors.
AShiningRay Jun 30, 2022
929af84
javax: bluetooth: UUID: Adjusting the UUID variables' types.
AShiningRay Jul 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/javax/bluetooth/DeviceClass.java
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{

public DeviceClass(int record) { System.out.println("DeviceClass record:" + record); }

public abstract int getMajorDeviceClass();

public abstract int getMinorDeviceClass();

public abstract int getServiceClasses();
}
43 changes: 43 additions & 0 deletions src/javax/bluetooth/DiscoveryAgent.java
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

Copy link
Copy Markdown
Collaborator

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?

javax.microedition.lcdui.Canvas is an example of a class that needs to be abstract. You'll see that the javadocs clearly label it as such:
https://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/lcdui/Canvas.html

{

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);
}
45 changes: 45 additions & 0 deletions src/javax/bluetooth/DiscoveryListener.java
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{

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);
}
39 changes: 39 additions & 0 deletions src/javax/bluetooth/L2CAPConnection.java
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;
}
28 changes: 28 additions & 0 deletions src/javax/bluetooth/L2CAPConnectionNotifier.java
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;

}
45 changes: 45 additions & 0 deletions src/javax/bluetooth/LocalDevice.java
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
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);
}
32 changes: 32 additions & 0 deletions src/javax/bluetooth/UUID.java
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
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();
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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.

24 changes: 24 additions & 0 deletions src/javax/microedition/io/file/ConnectionClosedException.java
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); }
}
90 changes: 90 additions & 0 deletions src/javax/microedition/io/file/FileConnection.java
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();
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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.

Loading