Method: FtdiC::Context#write_data

Defined in:
ext/ftdic.c

#write_data(v_str) ⇒ Object



129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'ext/ftdic.c', line 129

static VALUE ftdi_context_write_data(VALUE self, VALUE v_str)
{
  struct ftdi_context * ctx;
  char * buf = StringValuePtr(v_str);
  int size = RSTRING(v_str)->len;
  int result;

  Data_Get_Struct(self, struct ftdi_context, ctx);

  result = ftdi_write_data(ctx, (unsigned char *)buf, size);
  check_ftdi_result(ctx, result);

  return Qnil;
}