How to extend Message status information (SMPP) - java

How can I get channel sending sms? I've read documentation GMS where was wrote, if you want to get extend message status you should add TLV heading 0x1410, but how can I do that??
Some information from documentation:
[smpp tlv 32 octets]
000000A1: 14 10 tag: 0x1410
000000A3: 00 03 len: 3
000000A5: 32 3A 34 value: x:y
The status will be returned in the format x:y.
“x” – channel that returns the report or platform:
1 SMS
2 PUSH
3 VIBER
0 Internal error (GMS)
“y” – Message status
Report status return via Viber communication channel
- If Viber communication channel and DELIVRD status, “y” will have the value 23033 – Viber delivered
If someone know how to do that, please inform me

Related

Puzzling error inserting data into HKWorkoutRouteBuilder in watchOS 4 Beta 4

When I insert route data into HKWorkoutRouteBuilder I get the following error:
The connection to service named com.apple.healthd.server was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid
Here's a code snippet.
workoutRouteBuilder.insertRouteData(filteredLocations) { (success, error) in
if !success {
print("inserting route data failed with error: \(String(describing: error))")
}
}
I patterned by impelementation from the Speed Sloth example.
Any insights would be appreciated!
UPDATE:
Here's some more info from the watch logs. Looks like some sort of permission issue, but I haven't been able to track it down yet:
fault 13:21:14.664262 -0400 healthd
connection from pid 1705: Warning: Exception caught during invocation
of received message, dropping incoming message and invalidating the
connection. Exception: Invalid parameter not satisfying:
[authorizationStatuses count] == [typesIncludingParentTypes count]
Invalid parameter not satisfying: [authorizationStatuses count] ==
[typesIncludingParentTypes count] ( 0 CoreFoundation
0x1dc04d25 + 153 1 libobjc.A.dylib
0x1d227181 objc_exception_throw + 39 2 CoreFoundation
0x1dc04be5 + 1 3 Foundation
0x1e43c1cd + 93 4 HealthDaemon
0x2edf678f + 2015 5 HealthDaemon
0x2ee6eed1 + 143 6 HealthDaemon
0x2ee6ec77 + 143 7 HealthDaemon
0x2ee7b99b + 485 8 HealthDaemon
0x2f0e1e1f + 143 9 Foundation
0x1e589393 + 19 10 Foundation
0x1e587<…>
I had the same problem. You need to ensure that you request authorisation from the user for:
// Objective C
[HKSeriesType workoutRouteType]
// Swift
HKSeriesType.workoutRoute()
The connection to service named com.apple.healthd.server was
interrupted, but the message was sent over an additional proxy and
therefore this proxy has become invalid
Seeing this message indicates that the system process handling the request has crashed or exited. You should file a bug with Apple. Look for healthd crash logs and include them.
Don’t forget to add request of WorkoutRoute for HKHealthStore at AppDelegate
Workout Route does not work with Simulator, and only works with some HKWorkoutActivityType like
.walking, .running on OS4
private func requestAccessToHealthKit() {
let healthStore = HKHealthStore()
let allTypes = Set([HKObjectType.workoutType(),
HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!,
HKObjectType.quantityType(forIdentifier: .distanceWalkingRunning)!])
if #available(watchOS 4.0, *) {
allTypes.insert(HKSeriesType.workoutRoute())
}
healthStore.requestAuthorization(toShare: allTypes, read: allTypes) { (success, error) in
if !success {
print(error?.localizedDescription ?? "")
}
}
}

Why java SIM card secure channel returns “do not match”?

I'm trying to install an applet on a SIM card wich supports java card V3.0.4. When I try to establish a secure channel to load the applet, the card returns an error:
mode_211
enable_trace
establish_context
card_connect
select -AID A000000151000000
Command --> 00A4040008A000000151000000
Wrapped command --> 00A4040008A000000151000000
Response <-- 6F108408A000000151000000A5049F6501FF9000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 79AA24D80FF0056101F1D9AB6DCAF0E6
-enc_key 79AA24D80FF0056101F1D9AB6DCAF0E6
Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664A734806072A864886FC6B01600B06092A864886FC6B020202630906072A86488
6FC6B03640B06092A864886FC6B048000640B06092A864886FC6B040255640B06092A864886FC6B0
481079000
Command --> 8050000008F05E65BF5254BC9F00
Wrapped command --> 8050000008F05E65BF5254BC9F00
Response <-- 00005147A5190C5352322002001C1F47B6C76BABFD305EBBC2CD1BB39000
mutual_authentication() returns 0x8030F00A (The Secure Channel Protocol passed and reported do not match.)
I'm using GPShell-1.4.4. I guess the problem is using wrong key set! Am I true or there is something else I cannot guess what?!
Thanks for your response,
(I am partly reusing an answer I wrote for your previous question which you suddenly deleted)
Error code GP211_ERROR_INCONSISTENT_SCP means that GPShell's intended SCP version mismatches with the real SCP version given by the card (see here).
Check the 12th byte of card response to INITIALIZE UPDATE -- Secure Channel Protocol identifier (see e.g. GP Card Specification 2.3, section E5.1.6) and use parameter -scp.
Alternatively you might want to use GlobalPlatformPro as GPShell is quite outdated...
Beware that you can block your card by issuing multiple INITIALIZE UPDATE commands without successful authentication!
As your current question contains the complete log it is possible to parse the Card Data tag giving (according to GP 2.2.1):
66 Card Data
73 Card Recognition Data / Discretionary Data Objects
06 OID
2A864886FC6B01 {globalPlatform 1} // Card Recognition Data
60 Application Tag 0
06 OID
2A864886FC6B020202 {globalPlatform 2 2 2} // GP 2.2 Card
63 Application Tag 3
06 OID
2A864886FC6B03 {globalPlatform 3} // Card Identification Scheme
64 Application Tag 4
06 OID
2A864886FC6B048000 {globalPlatform 4 128 0x00} // SCP80 i=0x00
64 Application Tag 4
06 OID
2A864886FC6B040255 {globalPlatform 4 2 0x55} // SCP02 i=0x55
64 Application Tag 4
06 OID
2A864886FC6B048107 {globalPlatform 4 129 0x07} // SCP81 i=0x07
So you might want to use -scp 2 -scpimpl 0x55 or -scp 2 -scpimpl 85 (which happens to be the same).
Or use GlobalPlatformPro.
Alternatively -scpimpl 0x15 should work as well as the Well-known pseudo-random algorithm
(card challenge) bit in 'i' should not matter...
Good luck!

interfacing ht12d decoder to PIC microcontroller?

this is my first question here.
i have ht12d ic connected to pic16f84a.. VT pin connected to Rb0/int pin of pic.. and the 4 data lines are connected to 4 pins of PortB.. also am having a digital sensor also connected to rb0/int pin.. whenever there is interrupt either from the decoder ic or the sensor i ve managed to deal with these two sources of interrupts.. the problem is ht12d pins remains latched to last signal and don't return to default state.. in fact am using the status of these 4 pins to differentiate between the two interrupts.. for example :
proto:
if portb.b1 is 1 then its command 1;
if portb.b2 is 1 then its command2;
if portb.b3 is 1 then its command3;
if portb.b4 is 1 then its command4;
if they are all 0, then it's sensor interrupt ;
is there any way to reset ht12d data pins to default state after each valid transmission..

Addressing ECUs directly using ELM 327 dongle and ISO 9141

I have a VW Golf 4, which is quite old and talks KWP 2000 (ISO 9141) on its CAN bus. I use a dongle powered by ELM 327, connected to the OBD-2 port of the car.
I am trying to send messages individually to each ECU. I tried to change the header of the messages:
AT SH 48 XX F1 (I hoped XX would be the ECU ID; 48 is the flag for "use physical addressing"). Any command I issue (e.g. tried 3E for "tester present") returns NO DATA (I disabled automatic timeouts and set the timeout to maximum value).
Is there a way to send messages directly to the ECU? I am not interested in the set of data provided via OBD-2, neither do I want to re-flash the ECUs. At the moment I just try to find out which ECUs are available on the bus.
Thanks!
VW works on Transport Protocol TP 2.0, hence you need to initialize with 0x200 header.
https://jazdw.net/tp20
See above link for more info.

Apple Push Notifications Service ( APNS ): Feedback Service Response has missing byte?

I am writing a push notifications system in Ruby. Sending the notifications using the enhanced interface works fine, consuming from the Feedback Service is not working at all.
I wrote the code to read from the socket myself, something like this:
context = OpenSSL::SSL::SSLContext.new
context.cert = OpenSSL::X509::Certificate.new(File.read(pem_path))
context.key = OpenSSL::PKey::RSA.new(File.read(rsa_path))
#socket = TCPSocket.new(host, port)
#ssl = OpenSSL::SSL::SSLSocket.new(#socket, context)
#ssl.connect
#socket.gets #read(38) has the same effect FWIW
But the APNS Feedback Service returns only 37 bytes instead of the expected 38, and as expected the package is messes up.
I can replicate the error using the Ruby APNS gem (and openened a ticket for them here).
I've saved all I receive from the APNS Feedback Service to a file and here's what I get when trying to inspect the bytes:
ruby-1.9.2-p290 :035 > while b = f.readbyte
ruby-1.9.2-p290 :036?> puts b
ruby-1.9.2-p290 :037?> end
21
3
1
0
32
23
35
236
232
217
53
172
143
54
130
39
157
247
205
233
231
245
140
111
104
199
214
159
60
107
169
175
42
172
57
31
160
As you can see, the array is off by one, is should look like this:
Anyone had similar issues or can see what I am doing wrong?
Thanks
EDIT # 19/2011:
This seems to be an issue with Ruby sockets. Using the java-apns lib the following Clojure core returns the expected result for the same application, certificates and etc.
(def tokens (. (.. (APNS/newService)
(withCert "/Users/pcalcado/blah.p12" "blah")
withProductionDestination
build)
getInactiveDevices))
I cannot see anything special being done by java-apns or what I could be doing wrong in Ruby. I wouldn't mind using Clojure for this system but now I have everything but Feedback already written and running in Ruby on MRI =/
I asking myself... is it possible we have to read from #ssl instead of #socket?
Sorry but I am a bit n00b about Ruby programming :)
Edit:
I confirm you the problem is that you need to read from SSL socket
Look at this commit: https://github.com/muccy/APNS/commit/4d62a3f33c4b31f7f81a0020aa70871232f46781
Have a look at the APND gem by Josh Priddle. I used it successfully, and believe its core functionality, which includes retrieving feedback from Apple, works as it should. If for nothing else, it's another code example -- in Ruby -- for you to examine.

Resources