Class: Ucp::Pdu::Ucp30Operation

Inherits:
UCP30 show all
Defined in:
lib/ucp/pdu/ucp30_operation.rb

Constant Summary

Constants inherited from UCPMessage

Ucp::Pdu::UCPMessage::DELIMITER, Ucp::Pdu::UCPMessage::ETX, Ucp::Pdu::UCPMessage::STX

Instance Attribute Summary

Attributes inherited from UCPMessage

#dcs, #message_ref, #operation, #operation_type, #part_nr, #total_parts, #trn

Instance Method Summary collapse

Methods inherited from UCPMessage

#checksum, #get_field, #is_ack?, #is_nack?, #is_operation?, #is_result?, #length, #set_field, #set_fields, #to_s

Constructor Details

#initialize(fields = nil) ⇒ Ucp30Operation

Returns a new instance of Ucp30Operation.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ucp/pdu/ucp30_operation.rb', line 23

def initialize(fields=nil)
  super()
  @operation_type="O"
  @fields=[:adc,:oadc,:ac,:nrq,:nad,:npid,:dd,:ddt,:vp,:amsg]

  if fields.nil?
    return
  end

  @trn=fields[0]
  @operation_type=fields[2]
  @operation=fields[3]

  # 44/00077/O/30/0673845336//////1/1003961344/1203961200/4D657373616765204F4B/27

   for i in 4..(fields.length-1)
     field=@fields[i-4]
     @h[field]=fields[i]
   end


end

Instance Method Details

#basic_submit(originator, recipient, message, ucpfields = {}) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/ucp/pdu/ucp30_operation.rb', line 46

def basic_submit(originator,recipient,message,ucpfields={})

  # UCP30 only supports IRA encoded SMS (7bit GSM alphabet chars, encoded in 8bits)
  msg=UCP.ascii2ira(message).encoded

  # UCP30 does NOT support alphanumeric oadc
  oadc=originator

  @h={:oadc=>oadc, :adc=>recipient, :amsg=>msg}
  
  @h=@h.merge ucpfields
end