Android Question Is there a Winsock1 control similar to VB6.0 in B4A?

aeric

Expert
Licensed User
Longtime User
I think you may need to build a server or use mqtt protocol

 
Upvote 0

bskotu555

Member
Library:
B4A = NetWork
B4J = JNetWork


sample:
’listening
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
End Sub
‘get
Dim strData As String
Winsock1.GetData strData

In VB6.0, I used Winsock components to implement listening and content retrieval. I am not sure if there are similar components or related cases to use in B4A for reference.
 
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
B4X:
        Client.Initialize("Client")
        Client.Connect("192.168.0.10", 35000, 10000)
Most OBD wifi (if thats what you are implying) uses the above ip address and port number.

In Client success connection add
B4X:
AStreams.Initialize(Client.InputStream, Client.OutputStream, "AStreams")
 
Last edited:
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
B4X:
        Client.Initialize("Client")
        Client.Connect("192.168.0.10", 35000, 10000)
Most OBD wifi (if thats what you are implying) uses the above ip address and port number.

In Client success connection add
B4X:
AStreams.Initialize(Client.InputStream, Client.OutputStream, "AStreams")

#### Mode 01: Current Data
- **0100**: Request Supported PIDs (01-20)
- **0101**: Engine Coolant Temperature
- **0102**: Short Term Fuel Trim Bank 1
- **0103**: Long Term Fuel Trim Bank 1
- **0104**: Short Term Fuel Trim Bank 2
- **0105**: Long Term Fuel Trim Bank 2
- **0106**: Fuel Pressure
- **0107**: Intake Air Temperature
- **0108**: Mass Air Flow Rate
- **0109**: Throttle Position
- **010A**: Commanded Secondary Air Status
- **010B**: Oxygen Sensor Status
- **010C**: Engine RPM
- **010D**: Vehicle Speed
- **010E**: Timing Advance
- **010F**: Intake Air Pressure
- **0110**: Air Flow Rate from Mass Air Flow Sensor
- **0111**: Absolute Throttle Position B
- **0112**: Absolute Throttle Position C
- **0113**: Acceleration Pedal Position D
- **0114**: Acceleration Pedal Position E
- **0115**: Acceleration Pedal Position F
- **0116**: Commanded Throttle Actuator Control
- **0117**: Time Since Engine Start
- **0118**: Engine Fuel Rate
- **0119**: Emission Requirements (OBD II)

#### Mode 02: Freeze Frame Data
- **0200**: Request Freeze Frame Data

#### Mode 03: Diagnostic Trouble Codes (DTCs)
- **0300**: Request DTCs

#### Mode 04: Clear Diagnostic Trouble Codes (DTCs)
- **0401**: Clear DTCs and Freeze Frame Data

#### Mode 05: Oxygen Sensor Monitoring Test Results
- **0500**: Oxygen Sensor Monitoring Test Results (Sensor 1)
- **0501**: Oxygen Sensor Monitoring Test Results (Sensor 2)

#### Mode 06: Test Results - Non-continuous Monitoring
- **0600**: Request Non-continuous DTCs Test Results

#### Mode 07: Show Pending Trouble Codes (DTCs)
- **0700**: Request Pending DTCs

#### Mode 08: Control Operation of an Actuator
- **0800 - 08FF**: Control operation of actuators (specific commands vary by manufacturer)

#### Mode 09: Request Vehicle Information
- **0900 - 090F**:
- **0902**: VIN (Vehicle Identification Number)
- **0905**: Calibration ID or Calibration Verification Number (CVN)
- **090C**: In-use Performance Tracking (IUPT)

#### Mode 0A: Request Permanent Diagnostic Trouble Codes (DTCs)
- **0A00 - 0AFF**
 
Upvote 0
Top