ruby_ucp 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/CHANGELOG +42 -0
  2. data/LICENSE +505 -0
  3. data/README +10 -0
  4. data/Rakefile +118 -0
  5. data/Rakefile.orig +45 -0
  6. data/VERSION +1 -0
  7. data/lib/ruby_ucp.rb +42 -0
  8. data/lib/samples/main.rb +182 -0
  9. data/lib/ucp/base.rb +24 -0
  10. data/lib/ucp/pdu/base.rb +22 -0
  11. data/lib/ucp/pdu/ucp01.rb +37 -0
  12. data/lib/ucp/pdu/ucp01_operation.rb +61 -0
  13. data/lib/ucp/pdu/ucp01_result.rb +60 -0
  14. data/lib/ucp/pdu/ucp30.rb +28 -0
  15. data/lib/ucp/pdu/ucp30_operation.rb +59 -0
  16. data/lib/ucp/pdu/ucp30_result.rb +63 -0
  17. data/lib/ucp/pdu/ucp31.rb +29 -0
  18. data/lib/ucp/pdu/ucp31_operation.rb +50 -0
  19. data/lib/ucp/pdu/ucp31_result.rb +61 -0
  20. data/lib/ucp/pdu/ucp51_operation.rb +167 -0
  21. data/lib/ucp/pdu/ucp51_result.rb +64 -0
  22. data/lib/ucp/pdu/ucp52_operation.rb +31 -0
  23. data/lib/ucp/pdu/ucp52_result.rb +31 -0
  24. data/lib/ucp/pdu/ucp53_operation.rb +31 -0
  25. data/lib/ucp/pdu/ucp53_result.rb +31 -0
  26. data/lib/ucp/pdu/ucp54_operation.rb +31 -0
  27. data/lib/ucp/pdu/ucp54_result.rb +31 -0
  28. data/lib/ucp/pdu/ucp55_operation.rb +31 -0
  29. data/lib/ucp/pdu/ucp55_result.rb +31 -0
  30. data/lib/ucp/pdu/ucp56_operation.rb +31 -0
  31. data/lib/ucp/pdu/ucp56_result.rb +31 -0
  32. data/lib/ucp/pdu/ucp57_operation.rb +31 -0
  33. data/lib/ucp/pdu/ucp57_result.rb +31 -0
  34. data/lib/ucp/pdu/ucp58_operation.rb +31 -0
  35. data/lib/ucp/pdu/ucp58_result.rb +31 -0
  36. data/lib/ucp/pdu/ucp5x.rb +40 -0
  37. data/lib/ucp/pdu/ucp60.rb +30 -0
  38. data/lib/ucp/pdu/ucp60_operation.rb +58 -0
  39. data/lib/ucp/pdu/ucp60_result.rb +60 -0
  40. data/lib/ucp/pdu/ucp61.rb +31 -0
  41. data/lib/ucp/pdu/ucp61_operation.rb +49 -0
  42. data/lib/ucp/pdu/ucp61_result.rb +60 -0
  43. data/lib/ucp/pdu/ucp_operation.rb +27 -0
  44. data/lib/ucp/pdu/ucp_result.rb +26 -0
  45. data/lib/ucp/pdu/ucpmessage.rb +125 -0
  46. data/lib/ucp/util/base.rb +22 -0
  47. data/lib/ucp/util/gsm_packed_msg.rb +50 -0
  48. data/lib/ucp/util/packed_msg.rb +34 -0
  49. data/lib/ucp/util/sms_request.rb +48 -0
  50. data/lib/ucp/util/ucp.rb +885 -0
  51. data/lib/ucp/util/ucp_client.rb +207 -0
  52. data/lib/ucp/util/ucp_server.rb +122 -0
  53. data/lib/ucp/util/ucs2_packed_msg.rb +29 -0
  54. metadata +120 -0
@@ -0,0 +1,34 @@
1
+ =begin
2
+ Ruby library implementation of EMI/UCP protocol v4.6 for SMS
3
+ Copyright (C) 2011, Sergio Freire <sergio.freire@gmail.com>
4
+
5
+ This library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License as published by the Free Software Foundation; either
8
+ version 2.1 of the License, or (at your option) any later version.
9
+
10
+ This library is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public
16
+ License along with this library; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ =end
19
+
20
+
21
+ class Ucp::Util::PackedMsg
22
+
23
+ attr_reader :encoded,:unencoded,:chars,:required_octets,:required_septets, :tainted
24
+
25
+ def initialize
26
+ @encoded=""
27
+ @unencoded=""
28
+ @required_septets=0
29
+ @required_octets=0
30
+ @chars=0
31
+ @tainted=false
32
+ end
33
+
34
+ end
@@ -0,0 +1,48 @@
1
+ =begin
2
+ Ruby library implementation of EMI/UCP protocol v4.6 for SMS
3
+ Copyright (C) 2011, Sergio Freire <sergio.freire@gmail.com>
4
+
5
+ This library is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Lesser General Public
7
+ License as published by the Free Software Foundation; either
8
+ version 2.1 of the License, or (at your option) any later version.
9
+
10
+ This library is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public
16
+ License along with this library; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ =end
19
+
20
+
21
+ class Ucp::Util::SmsRequest
22
+
23
+ attr_reader :source_ip, :source_port, :originator, :recipient, :text, :account, :message_ref, :part_nr, :total_parts
24
+
25
+ def initialize(originator,recipient,text,account=nil,source_ip=nil,source_port=nil)
26
+ @account=account
27
+ @source_ip=source_ip
28
+ @source_port=source_port
29
+ @originator=originator
30
+ @recipient=recipient
31
+ @text=text
32
+ end
33
+
34
+ def set_parts_info(message_ref,part_nr,total_parts)
35
+ @message_ref=message_ref
36
+ @part_nr=part_nr
37
+ @total_parts=total_parts
38
+ end
39
+
40
+ def complete?
41
+ return @total_parts==1
42
+ end
43
+
44
+ def partial?
45
+ return @total_parts>1
46
+ end
47
+
48
+ end