Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 11-19-2014, 07:33 AM   #1
LQ Newbie
Registered: Oct 2014
Posts: 4

Rep: Reputation: Disabled
About errno:70, writing data to Fm1188 voice chip

Hi friends,
I try to write to a voice processesor,

The i2c-2 device open succesfully, and Slave adress set successfully
But "write" returns -1 value and I get errno:70(Commnication error on send)

Anyone have detailed information about Errno:70, what caused errno:70? I couldnt find useful info yet about it.

Part of my code below:

JNIEXPORT jint JNICALL Java_com_I2CInterface_i2cwrite
  (JNIEnv * env, jclass jc, jintArray data)
   jint rc = -1;

   jint *buffer = (*env)->GetByteArrayElements(env, data, NULL);

   if (NULL == buffer)
      LOGE("Buffer empty");
      return 0;
   // Get data length
   jsize data_len = (*env)->GetArrayLength(env, data);
   LOGI("data_len = %d", data_len);

   // i2c-dev open
   int fd = open("/dev/i2c-2", O_RDWR);
   LOGI("fd return value = %d",fd);

   if(fd > 0)
int SLAVEADDR=0x60;
int in=ioctl(fd, I2C_SLAVE_FORCE, SLAVEADDR);
LOGI("IOCTL value: %d",in);

      if( in < 0)
    	 char* error_str = strerror(errno);
         LOGE("Slave Address could not set, errno = %d (%s)", errno, error_str);
         goto _error;

// writing data
int mq=write(fd, buffer, data_len);
LOGI("Write retun value: %d",mq);
     if(mq != data_len)
     char* error_str = strerror(errno);
     LOGE("Couldnt write data!, errno = %d (%s)", errno, error_str);
     goto _error;

      LOGI("Data write succesfully \n");
      rc = 0;

      char* error_str = strerror(errno);
      LOGE("i2c device couldnt open-> I2C port 1, errno = %d (%s)", errno, error_str);

   return (rc);

Last edited by ylmzekrm; 11-19-2014 at 07:34 AM.


embedded, linux command, serial port

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ErrNo 14 and ErrNo 256 in yum server configuration nivedhitha Linux - Server 4 05-22-2011 01:45 AM
I'm writing a CHIP-8 emulator, and have a lot of questions. Anikom15 Programming 13 12-24-2009 12:47 AM
LXer: Reinventing Voice & Data Networks LXer Syndicated Linux News 0 09-14-2006 08:03 PM
Problem with reading/writing GPIO on video card with bttv compatible chip boky Linux - Hardware 0 10-13-2005 06:08 AM
GVC 56 k external modem (Data, fax, voice) yagneshmistry Linux - Hardware 0 08-11-2004 11:24 PM > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration