Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
sensor calibration file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
namaRyo  
View profile  
 More options Jun 14 2010, 11:29 pm
From: namaRyo <r.ikuy...@gmail.com>
Date: Mon, 14 Jun 2010 20:29:42 -0700 (PDT)
Local: Mon, Jun 14 2010 11:29 pm
Subject: sensor calibration file
Hi, this is nama.

I made "sensors.default.so" for arm9 dev.board - Armadillo440 (http://
www.atmark-techno.com/products/armadillo/a440)
use I2C accelerometer and magnetic filed sensors. and calculate to
orientation.

I want to save sensor calibration data to internal file at
"sensors.c". and try, but, permission error occurred.

How can I write to internal file system from "sensors.default.so" ?

thanks,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Deva R  
View profile  
 More options Jun 15 2010, 2:51 pm
From: Deva R <r.deva...@gmail.com>
Date: Wed, 16 Jun 2010 00:21:18 +0530
Local: Tues, Jun 15 2010 2:51 pm
Subject: Re: [android-porting] sensor calibration file

There might be better ways, but to start with you can refer our sample debug
code, where we dump video frame data to files in filesystem.
http://git.omapzoom.org/?p=platform/hardware/ti/omap3.git;a=blob;f=li...

from native libraries, you can do file operations with below calls..
fopen(filepath)
fwrite()
fclose()

Also, you might want to make sure the filepath have write access for the
process (a simple `chmod 777 <filepath>` will suffice)

-Deva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RYO IKUYAMA  
View profile  
 More options Jun 15 2010, 10:27 pm
From: RYO IKUYAMA <r.ikuy...@gmail.com>
Date: Wed, 16 Jun 2010 11:27:10 +0900
Local: Tues, Jun 15 2010 10:27 pm
Subject: Re: [android-porting] sensor calibration file
Hi, Deva

Thanks advice and sample code.
Before, I used fputs() and fgets(). then, fputs() was not able to be
done though fgets() was able to be done. filepath permission is set to
777 beforehand.
Is the place of the folder path(.data/misc/cal/) bad? or  should I
use fwrite() ?
I try by using fwrite.

sensors.c (file write test)
------------
#define CALIBRATION_FILE        "/data/misc/cal/sensors.cal"

static native_handle_t* control__open_data_source(struct
sensors_control_context_t *dev)
{
        LOGD("control__open_data_source()");
        native_handle_t* handle;
        int fd = open_input(O_RDONLY);
        if (fd < 0) {
                return NULL;
        }

        handle = native_handle_create(1, 0);
        handle->data[0] = fd;

        LOGD("open calibration file '%s'",CALIBRATION_FILE);
        if ((fp = fopen(CALIBRATION_FILE, "rw")) == NULL) {
                LOGE("Couldn't open '%s'",CALIBRATION_FILE);
        } else {
                fputs("ABCDEFGHIJKLMN", fp);
                fclose(fp);
        }

        return handle;

}

--
nama


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Akash Choudhari  
View profile  
 More options Jun 16 2010, 8:41 am
From: Akash Choudhari <akas...@gmail.com>
Date: Wed, 16 Jun 2010 07:41:32 -0500
Local: Wed, Jun 16 2010 8:41 am
Subject: Re: [android-porting] sensor calibration file
FWRITE should work in your case

- Akash


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Deva R  
View profile  
 More options Jun 16 2010, 4:01 pm
From: Deva R <r.deva...@gmail.com>
Date: Thu, 17 Jun 2010 01:31:04 +0530
Local: Wed, Jun 16 2010 4:01 pm
Subject: Re: [android-porting] sensor calibration file

is fopen() successful or does it return errorcode?

>if ((fp = fopen(CALIBRATION_FILE, "rw")) == NULL) {

can you try fopen(CALIBRATION_FILE, "w+")?
i dont feel "rw" is right mode to pass..

-Deva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RYO IKUYAMA  
View profile  
 More options Jun 16 2010, 9:54 pm
From: RYO IKUYAMA <r.ikuy...@gmail.com>
Date: Thu, 17 Jun 2010 10:54:15 +0900
Local: Wed, Jun 16 2010 9:54 pm
Subject: Re: [android-porting] sensor calibration file
thanks Akash,

I have not tried it yet you off the schedule. I'll try today or tomorrow.

--
nama


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RYO IKUYAMA  
View profile  
 More options Jun 16 2010, 10:09 pm
From: RYO IKUYAMA <r.ikuy...@gmail.com>
Date: Thu, 17 Jun 2010 11:09:49 +0900
Local: Wed, Jun 16 2010 10:09 pm
Subject: Re: [android-porting] sensor calibration file
Thank you Deva,

I'll try to fix it soon and report results again.

--
nama


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RYO IKUYAMA  
View profile  
 More options Jun 17 2010, 12:11 am
From: RYO IKUYAMA <r.ikuy...@gmail.com>
Date: Thu, 17 Jun 2010 13:11:51 +0900
Local: Thurs, Jun 17 2010 12:11 am
Subject: Re: [android-porting] sensor calibration file
hi Deva,

I fixed fopen(filename, "rw") to fopen(filename, "w+").
then I can write to file.
simple mistake!! I am shame..

Thanks a lot.

--
nama


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »