Class: Sphero::Response::CollisionDetected

Inherits:
AsyncResponse show all
Defined in:
lib/sphero/response.rb

Constant Summary

Constants inherited from AsyncResponse

AsyncResponse::COLLISION_DETECTED, AsyncResponse::CONFIG_BLOCK, AsyncResponse::DLEN_LSB, AsyncResponse::DLEN_MSB, AsyncResponse::ID_CODE, AsyncResponse::LEVEL_1_DIAGNOSTIC, AsyncResponse::MACRO_MARKERS, AsyncResponse::POWER_NOTIFICATION, AsyncResponse::PRESLEEP_WARNING, AsyncResponse::SENSOR_DATA, AsyncResponse::VALID_REPONSES

Constants inherited from Sphero::Response

ASYNC_RESPONSE, CODE_OK, DLEN, MRSP, SEQ, SIMPLE_RESPONSE, SOP1, SOP2

Instance Method Summary collapse

Methods inherited from AsyncResponse

constantize, #empty?, response, #seq, #success?, valid?

Methods inherited from Sphero::Response

async?, #empty?, #initialize, #seq, simple?, #success?, #valid?

Constructor Details

This class inherits a constructor from Sphero::Response

Instance Method Details

#axisObject



182
183
184
# File 'lib/sphero/response.rb', line 182

def axis
  body[3]
end

#bodyObject



166
167
168
# File 'lib/sphero/response.rb', line 166

def body
  @body.unpack 'nnnCnnCN'
end

#speedObject



194
195
196
# File 'lib/sphero/response.rb', line 194

def speed
  body[6]
end

#timestampObject



198
199
200
# File 'lib/sphero/response.rb', line 198

def timestamp
  body[7]
end

#xObject



170
171
172
# File 'lib/sphero/response.rb', line 170

def x
  body[0]
end

#x_magnitudeObject



186
187
188
# File 'lib/sphero/response.rb', line 186

def x_magnitude
  body[4]
end

#yObject



174
175
176
# File 'lib/sphero/response.rb', line 174

def y
  body[1]
end

#y_magnitudeObject



190
191
192
# File 'lib/sphero/response.rb', line 190

def y_magnitude
  body[5]
end

#zObject



178
179
180
# File 'lib/sphero/response.rb', line 178

def z
  body[2]
end